Closed rikhen closed 1 year ago
Unfortunately this is a limitation of Gutenberg. If you were to rename/remove a native block, it would suffer the same issue without writing a transformation for it (which isn't possible with ACF).
If you edit your post with Gutenberg's code editor, you'll see how it stores the block data directly inside of the post content:
<!-- wp:acf/company-overview {"name":"acf/company-overview","data":{"name":"Example","_name":"field_company_overview_name"}} -->`
It's possible you could search-replace the block name as well as the block prefix (in this case, acf/company-overview
and field_company_overview
) with WP-CLI but I'm not sure if there's anything else at play that would prevent it from working. This would get extra complicated if you were to rename any of the field groups.
More or less, I'd try to avoid this situation if you can help it. 😅
Alright. I imagined it had nothing to do with the ACF composer itself. Thanks for the superfast reply, @Log1x!
Image I have created a block via
$ wp acorn acf:block HelloWorld"
and started using this block on a page. For some reason, I now want to change the title of the block to "ByeWorld". So I manually rename theapp\Blocks\HelloWorld.php
toByWorld.php
, change its class name toByeWorld
and all the related functions and finally rename the\resources\views\blocks\hello-world.blade.php
tobye-world.blade.php
.When reloading the page with the block, I obviously get the error
Your site doesn’t include support for the "acf/hello-world" block. You can leave this block intact or remove it entirely.
. So I have to delete the old block and insert the new block, but I have to start from scratch.By any change, is there a way to do this in an automated command (for example via the cli) without losing data?