Support

Account

Home Forums General Issues version 5.11 removed alignment classes from blocks

Solving

version 5.11 removed alignment classes from blocks

  • has anyone else experienced that if they have an ACF block set to align-right using the WP built in toggle that the align-right class is now removed and the ACF blocks to not work at all with the build in WP alignment toggles?

  • Hey @nickfmc,

    I’ve just tested this and it’s working okay for me. Could you share your block definition code (specifically the supports key)

  • I didn’t have any supports key on the affected block. Because you said that I tried adding Align=> true without any luck.

    ‘supports’=> [
    ‘align’=> true,

    acf_register_block_type(array(
      'name'              => 'button-block',
      'title'             => __('Button'),
      'description'       => __('Custom Button'),
      'render_template'   => 'template-part/block/button/button.php',
      'category'          => 'oneper',
      'icon'              => 'admin-site',
      'supports'		=> [
    		'align'			=> true
    	],
      'keywords'          => array( 'button' ),
      'enqueue_assets' 	=> function(){
      wp_enqueue_script( 'block-button', get_template_directory_uri() . '/template-part/block/button/button.js', array(), '', true );
      }
    ));
  • I figured it out… with version 5.11 I have to have the following code in my block code, prior to 5.11 this was not required for whatever reason.

    if( !empty($block['align']) ) {
        $className .= ' align' . $block['align'];
    }
  • Just wanted to chime in and say I had the same problem and downgraded to 5.10 for the time being. For me it wasn’t alignment but background colors which my theme heavily uses and which aren’t reflected in block classes anymore since 5.11.

    Block supports are as follows

    'color' => [
    	'background' => true,
    ],

    Code for the block classes on custom blocks

    $classes = ['%block_class_name%'];
    if (!empty($block['className'])) {
    	$classes = array_merge($classes, explode(' ', $block['className']));
    }

    Then code inbetween that may or may not add classes with array_push($classes) and finally something like
    <div class="<?= esc_attr(join(' ', $classes)); ?>">

    Only custom classes are still added, everything else is missing and returns NULL.

  • @hakdesign have you tried this code?

    if( !empty($block['className']) ) {
        $className .= ' ' . $block['className'];
    }
  • then your echo would just be like this.. but playing with this issue I wonder if that works for you on 5.11 too?

    <?php echo esc_attr($className); ?>

  • Downie 4.3.8 Mac Crack Free Download Full Version Do you want the software to download youtube and different videos on Mac? In that case, simply try to download Downie 4.38 for Mac unfastened with the state-of-the-art crack. Downie is a software program particularly constructed for coping with download for your Mac.

    Serato DJ Pro Crack
    is widely used and is one of the best mixers for managing melodies and video clips of electronic or complex music files. Combine high-quality and impressive events with tons of moments, unique prompts, and create a music club. With help, you can fully present information about your voice. In addition, in this paragraph, you can participate in the general repetition of tones. In addition, You can also see your music on the screen

    MassPlanner 4.6.4.8 Crack With Torrent Full Version

    MassPlanner 4.6.4.8 Crack With Torrent Key FREE Download! MassPlanner Crack is a first-rate and extra beneficial device withinside the SocialMedia market. It is a well-known device for social media progress.

  • GSA Search Engine ranker Crack is an effective and easy-to-use search engine optimization oneway link application to assist help you in attending to the pinnacle role in net seek engines. It lets in helps you to installation a posting agenda so that you don’t get banned in case you’re constructing a couple of hyperlinks from an identical web page. Try to the area it out so your hyperlinks don’t get deleted or something like that.

    MediaMonkey Gold Crack is a track overseer and track participant for licensed track specialists. It documents your CDs and your sound statistics together with OGG, WMA, MPC, FLAC, APE, WAV, and MP3. It gives a wonderful call manager that investigates lacking Album Art and tracks statistics via way of means of strategies for Freedb and the web. The software furthermore has an automatic document and listing namer to mastermind your track library.

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

You must be logged in to reply to this topic.