AdvancedCustomFields / acf

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

ACF block mode is not working as excpected #857

Open zoxidovuz opened 11 months ago

zoxidovuz commented 11 months ago

Hi, I want to do preview mode as default.

I added that. 'mode' => 'preview', but it is working only for new blocks. When I want to edit old posts blocks open in edit or preview mode.

For example, I created a new post and added a block. Then I switched it to edit mode and published the post. If I refresh the page block is in edit mode. Because I published posts when the block was in edit mode. How can I solve it? I want to always blocks be in preview mode.

Thank you!

CreativeDive commented 11 months ago

Hey @zoxidovuz

maybe set 'mode' => false, could be the right solution for you. But that will disable edit mode completely. Personally, I don't regret turning off edit mode. Personally I like it when the user is always prompted to use the sidebar.

zoxidovuz commented 11 months ago

Hi @CreativeDive

thank you for responding. I tried it but the block is still opening in edit mode and there is no button to change mode. This is happening for updating posts.

CreativeDive commented 11 months ago

Do you use block.json for ACF blocks?

zoxidovuz commented 11 months ago

I am using acf_register_block_type function

CreativeDive commented 11 months ago

This might be the reason why mode : false doesn't work in your case. I'm using block.json and never saw edit mode again after setting each block type to mode : false.