Support

Account

Home Forums ACF PRO Native customization options in ACF blocks

Unread

Native customization options in ACF blocks

  • Hello. I hope you have a good day.

    Do you know of any article that explains how to use all WP native options in ACF blocks?

    I know how to configure the width, text color and background color but I would be interested in also using the margins, text size, typography… I know this thanks to the example of creating the “testimonial” block and I’m not a great developer of PHP to figure out how to do it though I tried.

    I use the new WP Block Based Theme

    $textColor = isset( $block['textColor'] ) ? $block['textColor'] : 'secondary';
    
    if ( substr( $textColor, 0, 1 ) !== '#' && substr( $textColor, 0, 4 ) !== 'rgb(' ) {
        $textColor = 'var(--wp--preset--color--' . $textColor . ')';
    }
    
    $backgroundColor = isset( $block['backgroundColor'] ) ? $block['backgroundColor'] : 'secondary';
    
    if ( substr( $backgroundColor, 0, 1 ) !== '#' && substr( $backgroundColor, 0, 4 ) !== 'rgb(' ) {
        $backgroundColor = 'var(--wp--preset--color--' . $backgroundColor . ')';
    }

    Greetings and thanks

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.