Home › Forums › Gutenberg › Change _underscore names to -dash names without loosing content › Reply To: Change _underscore names to -dash names without loosing content
I can’t tell you how to name blocks, I don’t use them. If it makes more sense to name blocks with a dash than an underscore then I would just use dashes in the future. I don’t see how this would be affected by a field name unless you are dynamically naming your blocks based on the field name.
Using underscores in really still the best practice for field names. The reason for this is that there are places where arrays are extracted to variables. How often this happens and were I’m not sure. But array indexes with dashes cannot be extracted.
Quite honestly, not knowing much about blocks, I would say that it has something to do with how WP is parsing the block names when looking at “allowed_block_types_all” You might want to look at this filter: allowed_block_types_all.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.