Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Block without Editable Fields and without edit mode disabled still has Edit icon in toolbar when using Block API v3

Đang mở
#1,002 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
php, wordpress
Lĩnh vực
frontend, web-dev

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện sự cố với một block không có field groups, trong đó acf.mode được đặt thành preview và supports.mode được đặt thành false. So sánh Block API v3 toolbar với v2, sau đó xác minh rằng Edit icon không xuất hiện trên v3 toolbar khi fix hoàn tất.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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:

  1. Create a block without any field groups assigned to it
  2. In its block.json, set acf:mode = preview, and set supports:mode = false
  3. Insert the block on a Post
  4. 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
Image

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
Ngôn ngữ chính
PHP
Star
948
Fork
198
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của AdvancedCustomFields/acf

Tất cả issue của AdvancedCustomFields/acf

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.