Support

Account

Home Forums Gutenberg Registering a block type with align only allowed full also has align none

Helping

Registering a block type with align only allowed full also has align none

  • Hello,

    I am registering a block type in which I set the align property to be only full, but in the editor I also get the none option.

    My goal is for the block type to appear in the backend in full width and only in full width. I want to control the width in the frontend based on custom fileds that I have set on my own.

    Here is the code I have:

    acf_register_block_type( array(
        'name'            => 'nvm-section',
        'title'           => 'Nvm Section',
        'description'     => 'A generic section to contain rows and columns of content.',
        'render_template' => 'inc/blocks/section/section-render.php',
        'category'        => 'nevma',
        'icon'            => 'schedule',
        'keywords'        => array( 'section', 'layout' ),
        'mode'            => 'preview',
        'align'           => 'full',
        'supports'        => array(
            'align' => ['full'],
            'align_content' => false,
            'full_height' => false,
            'mode' => true,
            'jsx' => true
        )
    ));

    And here is what I see in the backend: https://prnt.sc/OmanuaMMerVw.

    Is it natural that I get the none option as well there?

    Cheers,
    Takis

  • Here is the image from the link above in case the link is invalidated.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.