Automattic\WooCommerce\Blocks\Utils
StyleAttributesUtils::get_align_class_and_style()
Get class and style for align from attributes.
{} Это метод класса: StyleAttributesUtils{}
Хуков нет.
Возвращает
(Массив
. | null)
Использование
$result = StyleAttributesUtils::get_align_class_and_style( $attributes );
- $attributes(массив) (обязательный)
- Block attributes.
Код StyleAttributesUtils::get_align_class_and_style() StyleAttributesUtils::get align class and style WC 6.8.0
public static function get_align_class_and_style( $attributes ) { $align_attribute = isset( $attributes['align'] ) ? $attributes['align'] : null; if ( ! $align_attribute ) { return null; }; if ( 'wide' === $align_attribute ) { return array( 'class' => 'alignwide', 'style' => null, ); } if ( 'full' === $align_attribute ) { return array( 'class' => 'alignfull', 'style' => null, ); } if ( 'left' === $align_attribute ) { return array( 'class' => 'alignleft', 'style' => null, ); } if ( 'right' === $align_attribute ) { return array( 'class' => 'alignright', 'style' => null, ); } if ( 'center' === $align_attribute ) { return array( 'class' => 'aligncenter', 'style' => null, ); } return null; }