AdvancedCustomFields / AdvancedCustomFields/acf

InnerBlocks template bug

Open
#719 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
945
Forks
197
PR merge metrics
No merged PRs in 30d

Description

When creating a new block that contains an InnerBlock with a default template, it appears that removing all items from the InnerBlock and refreshing the page reinstates the default template code instead of remaining empty. Is this intentional, or is there a fix for this? I noticed it cropped up during the 6.0 build process. Example render code below:

$template = [ [ 'core/heading', [ 'level' => 2, 'content' => 'Title' ] ] ]; echo '<InnerBlocks class="block-post-listing__title" template="' . esc_attr( wp_json_encode( $template ) ) . '" allowedBlocks="' . esc_attr( wp_json_encode( [ 'core/heading', 'core/paragraph' ] ) ) . '" />';

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided InnerBlocks render example and reproduce the behavior by removing all nested items, saving, and refreshing the page. Trace how the default template is applied during reload; done means an intentionally emptied InnerBlock stays empty instead of restoring the template.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
content, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.