AdvancedCustomFields / AdvancedCustomFields/acf
Locking InnerBlocks Template
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to create a parent-child block in ACF by using InnerBlocks. The behavior I want is to lock the parent with some templates in the inner blocks like:
$template = [
[
"acf/acfb-my-child-block",
[]
],
[
"acf/acfb-my-child-block",
[]
]
];
<InnerBlocks templateLock="all" template="<?php echo esc_attr( wp_json_encode( $template ) ) ?>" />
Now user can insert more blocks from the child block like:
$template = [
[
'core/paragraph',
[]
]
];
<InnerBlocks template="<?php echo esc_attr( wp_json_encode( $template ) ) ?>" />
But due to the templateLock="all" applied on the parent block the child block can't insert new blocks. After some research, I've found that maybe templateLock="false" on child block can fix the issue but this InnerBlocks functionality is not available in ACF?
Any solution, suggestions will be much appreciated!
Thanks
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the PHP reproduction in the issue and inspect ACF's InnerBlocks support alongside WordPress's parent and child templateLock behavior. Determine whether nested blocks can override the parent's lock, then define the relevant implementation or documentation change and verify it with a focused reproduction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100