Home › Forums › General Issues › get_block_wrapper_attributes() not applying text alignment classes. › Reply To: get_block_wrapper_attributes() not applying text alignment classes.
I’ve notice that You need to add:
if ( ! empty( $block['align'] ) ) {
$class_name .= ' align' . $block['align'];
}
if ( ! empty( $block['alignText'] ) ) {
$class_name .= ' text-align-' . $block['alignText'];
}
in block PHP file to render this values properly on frontend.
I’ve spend dozens hours to test everything, it’s not perfect to create block with ACF, but I can managed that to work with them.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.