Automattic\WooCommerce\Blocks\Utils
StyleAttributesUtils::get_text_align_class_and_style()
Get class and style for text align from attributes.
Method of the class: StyleAttributesUtils{}
No Hooks.
Return
Array
.
Usage
$result = StyleAttributesUtils::get_text_align_class_and_style( $attributes );
- $attributes(array) (required)
- Block attributes.
StyleAttributesUtils::get_text_align_class_and_style() StyleAttributesUtils::get text align class and style code WC 9.3.3
public static function get_text_align_class_and_style( $attributes ) { if ( isset( $attributes['textAlign'] ) ) { return array( 'class' => 'has-text-align-' . $attributes['textAlign'], 'style' => null, ); } return self::EMPTY_STYLE; }