Support

Account

Home Forums Gutenberg Incorrect 'align' value in acf_register_block_type

Unread

Incorrect 'align' value in acf_register_block_type

    • lunule

    • November 13, 2019 at 4:46 am

    Hello,

    Great plugin, one of my favorites!! 🙂

    So – I’m using the new blocks feature in a new project, it’s really a lifesaver, but there seems to be a bug.

    Based on the documentation (https://www.advancedcustomfields.com/resources/acf_register_block_type/) there are two “slots” to define block alignment, one on “parent level”, and another one in the ‘supports’ sub-array:

    acf_register_block_type(array(
        // (...)
        'align' 		=> '',
        // (...)
        'supports' 		=> array(
        	'align' 	=> false,
    	),
    ));

    Now, what I see is that the automatically added/generated class name, based on the align value, can not be totally “nulled”. Even if align has the value false in the supports sub-array, there’s an alignleft class generated on the front-end. Which is a problem, because our stylesheet defines a left float for elements having the alignleft class.

    Is there any way to stop ACF generating an alignment class in the block output on the frontend?

    Thanks!

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.