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
When I generated a new block called Hero and I tried to overwrite the prefix from acf/ to custom/ for example. Problem was that it still rendered with acf/ prefix in the Gutenberg editor. So all my fields were missing from the block. But, when I cached the block.json using wp acorn acf:cache, then it had the correct prefix. But problem with caching was that I had to add re-insert the block for it to work again. Since it showed that acf/hero block was missing. Same problem goes overwriting the namespace.
public$prefix = 'custom/';
The text was updated successfully, but these errors were encountered:
After the block array is passed through that function, it's passed through the acf/register_block_type_args filter. So to overwrite the prefix for both cached and uncached blocks you would need to both set the $prefix property as done in the original post and hook into the acf/register_block_type_args with something like this:
When I generated a new block called Hero and I tried to overwrite the prefix from
acf/
tocustom/
for example. Problem was that it still rendered withacf/
prefix in the Gutenberg editor. So all my fields were missing from the block. But, when I cached the block.json usingwp acorn acf:cache
, then it had the correct prefix. But problem with caching was that I had to add re-insert the block for it to work again. Since it showed thatacf/hero
block was missing. Same problem goes overwriting the namespace.The text was updated successfully, but these errors were encountered: