web_page_content Shortcode
The web_page_content shortcode includes published shared content or displays a current-post field. It shares rendering with the Dynamic Content block and remains available when the Legacy Page Builder interface is disabled.
The attributes below match the current Page Builder controls and public output. Use raw syntax only for reviewed content that cannot be maintained through the visual controls.
Usage
[web_page_content type="other_post_content" page_content="123"]
[web_page_content type="post_title" post_title_with_link="yes"]
Attributes
| Attribute | Default | Accepted values | Purpose |
|---|---|---|---|
type |
other_post_content |
other_post_content, custom_meta, post_title, permalink, published_date, updated_date, featured_image, image_stored_in_meta |
Selects the rendering or behavior variant consumed by the shortcode. |
page_content |
— | A value selected from WordPress | Choose the page to display. Available when type is other_post_content. |
custom_meta |
— | Approved public scalar metadata key | Selects the current-post field. Available when type is custom_meta. |
custom_meta_default |
— | String unless stated otherwise | Default text if the custom meta is empty. Available when type is custom_meta. |
custom_meta_prefix |
— | String unless stated otherwise | Text that will appear before meta value. Available when type is custom_meta. |
custom_meta_suffix |
— | String unless stated otherwise | Text that will appear after meta value. Available when type is custom_meta. |
custom_meta_icon |
— | String unless stated otherwise | Controls the custom meta icon. Available when type is custom_meta. |
image_size |
full-original-ratio |
Theme size or registered WordPress image-size slug | Selects the library image size for both image modes. |
image_from_meta_name |
— | Approved public scalar metadata key | Contains an attachment ID or HTTP(S) image URL. Available when type is image_stored_in_meta. |
remove_wrapper |
— | yes |
Just render the content, no wrapper added with post ID etc. Available when type is other_post_content. |
device_visibility |
— | Space-separated web-hide-on-lg, web-hide-on-md, web-hide-on-sm, web-hide-on-xs |
Hides output at selected device ranges. Ignored when the inclusion wrapper is removed. |
el_id |
— | Valid unique HTML ID | Applies to the output element. Ignored when the inclusion wrapper is removed. |
el_class |
— | String unless stated otherwise | If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file. |
post_title_with_link |
— | yes |
Links the current title to its permalink. Available when type is post_title. |
Public metadata
Metadata must be a scalar value. An explicitly authored shortcode can display its named non-protected field without requiring WordPress REST registration. This preserves existing custom_meta and image_stored_in_meta content. Private or structured fields are omitted, even when a fallback is supplied. Zero is preserved. Shortcode values, prefixes, suffixes and fallback strings retain safe post HTML, including emphasis and links; executable markup is removed. The native block keeps these values as plain text.
Authored product shortcodes can also display these public storefront keys: _price, _regular_price, _sale_price, _sku, _weight, _length, _width, _height and _stock_status. Other protected keys still require explicit approval through the filter below; account, order and internal configuration metadata is not opened by this exception.
The Dynamic Content block's field picker defaults to non-protected, single-value fields registered with WordPress using show_in_rest and a scalar type.
Developers can explicitly approve another public scalar key for a post type:
add_filter('pom_dynamic_content_allowed_meta_keys', static function(array $keys, string $post_type): array {
if ($post_type === 'product') {
$keys[] = 'public_product_reference';
}
return $keys;
}, 10, 2);
Only select or approve fields intended for public display. Existing shortcodes naming non-protected scalar fields do not need to be rewritten or registered with REST.
Inclusion and live fields
Sources must belong to the current site, be published, have no password and pass the theme's permission rules. Public collections remain eligible when their individual post routes are disabled. Draft/private sources are not included even for an administrator. Current-post fields can be previewed on an editable draft through the authorized editor or frontend preview. Nested fields retain the consuming post context. Native blocks and Legacy shortcodes in the source both render.
Circular references are omitted. Inclusion is bounded to eight nested rendering levels, 64 included sources per root render and 1 MB per source. The existing discovery process resolves source dependencies and generated source CSS before the document head, with render-time fallback for late content. Dynamic Content adds no dedicated frontend stylesheet or script.
Library images use current metadata. External image URLs retain their source URL but cannot provide library alt text, dimensions or generated responsive sizes. remove_wrapper="yes" also removes the place where this shortcode's ID, classes and visibility would apply. Do not repeat a source containing anchors that must be unique.
Reusable block editing
When Other post content points to a reusable block, the backend builder preview displays the reusable block title and an Edit reusable block link. The link opens the linked block editor in a new tab so the page being composed remains open. WordPress permissions remain authoritative, so the edit link is available only to users who can edit the linked reusable block.
Verification
Save and preview populated and empty sources, current-post fields and nested blocks/shortcodes. Confirm the four device ranges, metadata fallback and image alt text. Edit the shared source and reload the consuming page without resaving it; clear any full-page cache if it still serves an earlier response.