AdvancedCustomFields / acf

Advanced Custom Fields
http://advancedcustomfields.com/
823 stars 168 forks source link

post title and post thumbnail not updating in the ACF Blocks #848

Open razaanstha opened 1 year ago

razaanstha commented 1 year ago

I have used the ACF function acf_register_block_type to register a new block. In the render template, I have included the post title and post thumbnail as the block title and background image, respectively. However, when the post title get_the_title() or thumbnail get_the_post_thumbnail() is updated dynamically, the block does not show the fresh data unless the post is reloaded.

arjendejong12 commented 12 months ago

It would be great if there was an option to trigger a block reload if you change the title or change the featured image.

razaanstha commented 12 months ago

@arjendejong12 exactly, I found out that this is possible to synchronize the post fields if you are using it as a template in <InnerBlocks /> like core/post-title, core/featured-image and other blocks connecting to posts fields but I found out that its not possible to sync when using the raw php functions directly in the render template.

cabrailsford commented 8 months ago

I know this is a bit late, but could you instead insert a core/pattern block for the render template, and use the core/post-title and core/featured-image inside the pattern? I don't know if that would get around the issue you're experiencing.