Skip to content

Commit

Permalink
Support the align attribute #12
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbingwide committed Jul 12, 2023
1 parent 3d23c0b commit e39578f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/class-acf-field-block-renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ function render_acf_field_classes($field_name, $field_type, $block)
if (!empty($block['className'])) {
$classes = array_merge($classes, explode(' ', $block['className']));
}
if ( isset( $block['align'] ) ) {
$classes = array_merge( $classes, [ 'has-text-align-' . $block['align'] ] );
}

$classes = implode(' ', $classes);
$anchor = $block['anchor'] ?? null;
$wrapper_attributes = get_block_wrapper_attributes(array('class' => trim($classes), 'id' => $anchor));
Expand Down

0 comments on commit e39578f

Please sign in to comment.