Automattic\WooCommerce\EmailEditor\Engine\Renderer\ContentRenderer\Postprocessors
Border_Style_Postprocessor::expand_shorthand_value
Expands shorthand border width and style values into individual properties.
Метод класса: Border_Style_Postprocessor{}
Хуков нет.
Возвращает
Массив<Строку,
. string> The expanded border values.
Использование
// private - только в коде основоного (родительского) класса $result = $this->expand_shorthand_value( $value ): array;
- $value(строка) (обязательный)
- The shorthand border value.
Код Border_Style_Postprocessor::expand_shorthand_value() Border Style Postprocessor::expand shorthand value WC 9.9.5
private function expand_shorthand_value( string $value ): array { $values = preg_split( '/\s+/', trim( $value ) ); if ( count( $values ) === 4 ) { return array( 'top' => $values[0], 'right' => $values[1], 'bottom' => $values[2], 'left' => $values[3], ); } if ( count( $values ) === 3 ) { return array( 'top' => $values[0], 'right' => $values[1], 'bottom' => $values[2], 'left' => $values[1], ); } if ( count( $values ) === 2 ) { return array( 'top' => $values[0], 'right' => $values[1], 'bottom' => $values[0], 'left' => $values[1], ); } if ( count( $values ) === 1 ) { return array( 'top' => $values[0], 'right' => $values[0], 'bottom' => $values[0], 'left' => $values[0], ); } return array(); }