tomast1953
Forum Replies Created
-
Hi Jeff,
Thank you for the fast response!
I checked our form settings: the Name field is enabled and required, and “Disable Replace Author” is not enabled.
However, on the frontend (using the Ollie block theme), the post still displays the fallback user’s name (“limbasan”) instead of the submitted name.
We tried using
get_post_meta($post->ID, 'usp-author', true)in a PHP snippet with therender_blockfilter forcore/post-author-name:`php<br>add_filter(‘render_block’, ‘usp_display_author_name’, 10, 2);<br>function usp_display_author_name($block_content, $block) {<br>if (isset($block[‘blockName’]) && $block[‘blockName’] === ‘core/post-author-name’) {<br>global $post;<br>if ($post && isset($post->ID)) {<br>$submitted_author = get_post_meta($post->ID, ‘usp-author’, true);<br>if (!empty($submitted_author)) {<br>return preg_replace(‘/>([^<]*)’ . esc_html($submitted_author) . ‘<‘, $block_content, 1);<br>}<br>}<br>}<br>return $block_content;<br>}</p> <p>Could you let us know:</p> <ol start=”1″> <li>Is <code>usp-author</code> saved when the post is created as “Pending” (before publishing)?</li> <li>Is there an official USP function or recommended filter to override the displayed author in FSE/block themes?</li> </ol> <p>Thanks again for your help!</p>