Post Meta Text

Displays a post meta field as text.

Last modified: June 6, 2023

This block displays the value of a post meta field as text.
Select the meta key to display from the block settings panel.
You can also add a fixed label and select the tag for the meta value.

Please note that post meta fields have to be registered with show_in_rest enabled.

link Block name

t2/post-meta-text

link PHP Filters

apply_filters( 't2/blocks/post_meta_text', mixed $value, int $post_id, string $meta_key )

Filters the post meta value.

Parameter Type Description
$value mixed The post meta value.
$post_id int The post ID.
$meta_key string The meta key.
apply_filters( 't2/blocks/post_meta_text/{$meta_key}', mixed $value, int $post_id, string $meta_key )

Filters the post meta value.

Parameter Type Description
$value mixed The post meta value.
$post_id int The post ID.
$meta_key string The meta key.