You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug only appears when the Yoast SEO plugin is enabled.
After adding an ACF block to the editor, and immediatly saving the post, the block is not rendered on the frontend.
Awkward work-around: make another change in the editor before clicking update. (For example: add another block, switch the ACF block to visual mode, check any checkbox indise the block.)
Here's an example with a block that has no fields:
This made me wonder, what if I add a block that does have fields. It has the same behaviour. However, any interaction in the block (like checking the checkbox) will make the block render properly on the frontend.
How to reproduce?
Install the latest versions of WP, Yoast SEO and ACF Pro (currently WP 5.6.1 / Yoast 15.7 / ACF Pro 5.9.4)
Add this code to your functions.php
add_action('acf/init', 'my_acf_blocks_init');
function my_acf_blocks_init() {
// Check function exists.
if( function_exists('acf_register_block_type') ) {
// Register a testimonial block.
acf_register_block_type(array(
'name' => 'testimonial',
'title' => __('Testimonial'),
'description' => __('A custom testimonial block.'),
'category' => 'formatting',
'mode' => 'edit',
'render_callback' => function() {
echo '<p>This text should be displayed on the frontend</p>';
},
));
}
}
This bug only appears when the Yoast SEO plugin is enabled.
After adding an ACF block to the editor, and immediatly saving the post, the block is not rendered on the frontend.
Awkward work-around: make another change in the editor before clicking update. (For example: add another block, switch the ACF block to visual mode, check any checkbox indise the block.)
Here's an example with a block that has no fields:
This made me wonder, what if I add a block that does have fields. It has the same behaviour. However, any interaction in the block (like checking the checkbox) will make the block render properly on the frontend.
How to reproduce?
Install the latest versions of WP, Yoast SEO and ACF Pro (currently WP 5.6.1 / Yoast 15.7 / ACF Pro 5.9.4)
Add this code to your functions.php
Import this ACF field
The text was updated successfully, but these errors were encountered: