Make WordPress Core

Opened 6 weeks ago

Last modified 6 weeks ago

#65753 new defect (bug)

ACF Block fields showing in Sidebar Inspector instead of Editor Canvas in WP 7.0.2 (SCF v6.9.3 / ACF v6.8.6 vs 6.9.5)

Reported by: nishantkapadiya Owned by:
Priority: normal Milestone: Awaiting Review
Component: Editor Version: 7.0
Severity: normal Keywords:
Cc: Focuses: tests, administration

Description (last modified by nishantkapadiya)

Hi everyone,

I am noticing a change in behavior in how ACF/Secure Custom Fields (SCF) blocks render in the Gutenberg Block Editor when running on WordPress 7.0.2.

Environment Details:

WordPress Version: 7.0.2 (Backup site on 6.9.5)
Plugin: Secure Custom Fields (SCF) v6.9.3 / ACF Pro v6.8.6
Theme: Custom WP Theme

Issue Summary:

In WP 6.9.5: When creating a new page and adding an ACF block for the first time, the block's fields were rendered directly inside the main block editor canvas (in-context editing) as expected when 'mode' => 'edit' is set in acf_register_block_type().

In WP 7.0.2 (with SCF v6.9.3 / ACF v6.8.6), when inserting the same newly added block on a page for the first time:

The block fields automatically open inside the Right Sidebar (Block Inspector panel) under the Block tab.
For some blocks where template output returns 0 bytes when empty, Gutenberg renders an "Edit Block" placeholder button in the canvas, while blocks that echo empty <section> tags bypass this and place all fields into the sidebar inspector.

Sample Block Registration Code (acf_register_block_type):

<?php
acf_register_block_type( array(
    'name'            => 'wysiwyg',
    'title'           => __( 'WYSIWYG', 'text-domain' ),
    'render_callback' => 'theme_acf_block_render_callback',
    'category'        => 'custom-blocks',
    'icon'            => 'admin-comments',
    'mode'            => 'edit',
    'supports'        => array(
        'align' => true,
    ),
) );

Screenshot: https://prnt.sc/cBxF81YGS9Mb

Questions for the Community:

  1. Was there an intentional change in WP 7.0.2 or SCF v6.9.3 / ACF v6.8.6 regarding how initial block state / InspectorControls focus is handled for custom ACF blocks upon insertion?
  1. What is the recommended WP / ACF hook or filter to globally enforce default inline canvas editing for all registered blocks when creating a new page without hiding sidebar panels via custom CSS?

Any insights, filters, or best practices would be greatly appreciated!

Thanks!

Change History (4)

#1 @nishantkapadiya
6 weeks ago

  • Description modified (diff)

#2 follow-up: @westonruter
6 weeks ago

  • Keywords reporter-feedback added

Do you experience the same issue on WP 6.9.x? If so, this is probably not an issue for core and should be reported on the plugin side.

#3 in reply to: ↑ 2 @nishantkapadiya
6 weeks ago

Replying to westonruter:

Do you experience the same issue on WP 6.9.x? If so, this is probably not an issue for core and should be reported on the plugin side.

No. I have verified the behavior on both versions. The issue does not occur on WordPress 6.9.x. In WordPress 6.9.x, ACF block fields are displayed within the block as expected. The issue occurs only after upgrading to WordPress 7.0.x; newly added ACF blocks initially open in Preview mode, and their fields are displayed in the editor sidebar.

#4 @westonruter
6 weeks ago

  • Keywords reporter-feedback removed
  • Version 7.0.27.0
Note: See TracTickets for help on using tickets.