• Keith

    (@keithkhl)


    I’ve been using below code snippet to set images automatically aligned at center upon upload, but after 6.4 update, I have an error on post edit page.

    // changing default gutenberg image block alignment to "center"
    function change_default_gutenberg_image_block_options (){
      $block_type = WP_Block_Type_Registry::get_instance()->get_registered( "core/image" );
      $block_type->attributes['align']['default'] = 'center';
    }
    add_action( 'init', 'change_default_gutenberg_image_block_options');

    I guess one of the functions does not work with updated wordpress.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Keith

    (@keithkhl)

    The issue is persistent even after 6.4.1 upgrade.

    Mike Zielonka

    (@mikezielonka)

    +1

    Mark Jansen

    (@mark-jansen)

    I have the same issue.

    It results in the following error:

    TypeError: Cannot read properties of undefined (reading 'lightbox')
        at migrate (https://mysite.com/wp-includes/js/dist/block-library.js?ver=b79a74010bdb3250caf3:23675:19)
        at applyBlockDeprecatedVersions (https://mysite.com/wp-includes/js/dist/blocks.js?ver=1e16b1d8cd192ec1a469:13639:22)
        at parseRawBlock (https://mysite.com/wp-includes/js/dist/blocks.js?ver=1e16b1d8cd192ec1a469:13881:24)
        at https://mysite.com/wp-includes/js/dist/blocks.js?ver=1e16b1d8cd192ec1a469:13865:75
        at Array.map (<anonymous>)
        at parseRawBlock (https://mysite.com/wp-includes/js/dist/blocks.js?ver=1e16b1d8cd192ec1a469:13865:57)
        at https://mysite.com/wp-includes/js/dist/blocks.js?ver=1e16b1d8cd192ec1a469:13865:75
        at Array.map (<anonymous>)
        at parseRawBlock (https://mysite.com/wp-includes/js/dist/blocks.js?ver=1e16b1d8cd192ec1a469:13865:57)
        at https://mysite.com/wp-includes/js/dist/blocks.js?ver=1e16b1d8cd192ec1a469:13929:19

    This issue is still persistent in 6.4.2 as well.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Set image at center snippet doesn’t work after 6.4 update’ is closed to new replies.