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


$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.

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.