• i hook into gallery render callback and noticed when i enable your plugin, the ids of each image is missing in the callback function.

    function foo_check_block() {
        register_block_type( 'core/gallery', array(
            'render_callback' => 'foo_block_gallery_render',
        ) );
    }
    add_action( 'init', 'foo_check_block' );
    function foo_block_gallery_render( $attributes, $content ) {
        write_log($attributes);    
        return $content;
    }

    print_r:

    [28-Nov-2019 11:01:54 UTC] Array
    (
        [ids] => Array
            (
                [0] => 1317
                [1] => 1316
                [2] => 1315
                [3] => 1314
                [4] => 1313
                [5] => 1312
            )
    
        [imageCrop] => 
        [linkTo] => media
    )

    with your plugin:

    [28-Nov-2019 11:01:54 UTC] Array
    (
        [imageCrop] => 
        [linkTo] => media
    )

    why? can you please insert ids. thank you

  • The topic ‘[ids] missing from render callback’ is closed to new replies.