AdvancedCustomFields / AdvancedCustomFields/acf
Block without Editable Fields and without edit mode disabled still has Edit icon in toolbar when using Block API v3
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
A block without editable fields, and told to always be in preview mode, still has the Edit icon in its Block Toolbar when using Block API v3 (but not v2)
To Reproduce
Steps to reproduce the behavior:
- Create a block without any field groups assigned to it
- In its block.json, set acf:mode = preview, and set supports:mode = false
- Insert the block on a Post
- See that its toolbar has an Edit icon when using V3 of the Block API (but not if using V2)
Expected behavior
No Edit icon is present in the block toolbar.
Screenshots or Video
Code
`{
"name": "acf/ext-social-share-links",
"title": "Social Share Links",
"description": "Social Sharing Links",
"style": "file:./css/ext-social-share.css",
"icon": "share-alt2",
"category": "widgets",
"keywords": ["social", "share", "twitter", "facebook"],
"acf": {
"mode": "preview",
"renderTemplate": "block_template.php"
},
"supports": {
"align": false,
"alignText": true,
"color": {
"background": true,
"text": true,
"link": true
},
"jsx": false,
"mode": false,
"spacing": {
"blockGap": false,
"margin": [
"top",
"bottom"
],
"padding": true
}
},
"example": {
"attributes": {
"mode": "preview",
"data": {
"ext_acf_block_preview": 1
}
}
}
}`
Version Information:
- WordPress Version 6.9.1
- PHP Version 8.3.30
- ACF Version 6.7.1
- Browser Chrome 145.0.7632.160
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 by reproducing the issue with a block that has no field groups, acf.mode set to preview, and supports.mode set to false. Compare the Block API v3 toolbar with v2, then verify that the Edit icon is absent from the v3 toolbar when the fix is complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100