Support

Account

Home Forums General Issues $className has changed and return filename?

Unread

$className has changed and return filename?

  • Since which version the $className has changed?

    On many websites the css doesn’t work anymore because the variable $className didn’t return only the class name for example news.

    Now it returns news wp-block-acf-news (news.php is the block filename).

    $className = 'news';
    if( !empty($block['className']) ) {
    	$className .= ' ' . $block['className'];
    }
    if( !empty($block['align']) ) {
    	$className .= ' align' . $block['align'];
    }

    I often used something like <div class="<?php echo esc_attr($className);?>-border overlay-container">

    Now the css can no longer grasp because the class “wp-block-acf-news” is displayed in front of it and not the block class “news” like before…

    Is this anything i can change? Or do I have to change all websites and all block classes now?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.