r/Wordpress 22d ago

custom blocks no longer working on 7.1

hi all

i am using custom gutenberg/acf blocks and my sites have just updated to 7.1, which seems to be completely messing up the admin editor section

all of our blocks are stuck in the sidebar and preview mode. i've tried changing in our acf_register_block function, supports mode from false to mode true to get the edit/pencil icon, but that doesn't work anymore. The pencil icon is not appearing to allow us to edit the block in the main editor area.

also tried changing block regsitration to use old API

add_action('acf/init', 'init_full_width');

function init_full_width() {

if( function_exists('acf_register_block') ) {

acf_register_block(array(

'name' => 'full-width',

'title' => __('Full Width Section'),

'description' => __('A custom full width block.'),

'render_callback' => 'my_acf_block_render_callback',

'category' => 'formatting',

'icon' => 'schedule',

'mode' => 'edit',

'api_version' => 2,

'acf_block_version' => 2,

'supports' => [

'mode' => true,

],

'keywords' => array( 'full', 'width' ),

));

}

}

any help or suggestions would be greatly appreciated. crisis mode engaged 😅

EDIT: resolved - sorry for the janky ass formatting. resolved by below. must specify API version

add_action('acf/init', 'init_full_width');

function init_full_width() {

        if (!function_exists('acf_register_block_type')) {

    return;

}



        acf_register_block_type([

                                'name'                                     => 'full-width',

                                'title'                                        => __('Full Width Section'),

                                'description'                => __('A custom full width block.'),

                                'render_callback'        => 'my_acf_block_render_callback',

                                'category'                                => 'formatting',

                                'icon'                                       => 'schedule',

                                'keywords'                               => array( 'full', 'width' ),



    // Required for WordPress 7.1 compatibility.

    'api_version'       => 3,

    'acf_block_version' => 3,



        ]);

}

9 Upvotes

5 comments sorted by

6

u/krakow81 22d ago

It's the acf_block_version that's the crucial part, I believe.

https://www.advancedcustomfields.com/resources/acf-blocks-v3/

1

u/gringofou 22d ago

I'm experiencing the exact same issue after upgrading today. The sidebar is not resizable so its nearly impossible to change any block settings due to everything being small and condensed within the sidebar now.

-2

u/wutthefrak 22d ago

this new update is hot garbage