wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi
wp_get_shadow_classes_and_styles › WordPress Function
Da7.3.0
Deprecaton/a
› wp_get_shadow_classes_and_styles ( $block_attributes )
| Parametri: |
|
| Ritorna: |
|
| Definito a: |
|
| Codex: |
Returns shadow classes and inline styles for block attributes, like the JS `getShadowClassesAndStyles()`. Does not check block support or skipped serialization.
Sorgenti
function wp_get_shadow_classes_and_styles( $block_attributes ) {
if ( ! is_array( $block_attributes ) ) {
return array();
}
$shadow = $block_attributes['style']['shadow'] ?? null;
$attributes = array();
$styles = wp_style_engine_get_styles( array( 'shadow' => $shadow ) );
if ( ! empty( $styles['classnames'] ) ) {
$attributes['class'] = $styles['classnames'];
}
if ( ! empty( $styles['css'] ) ) {
$attributes['style'] = $styles['css'];
}
return $attributes;
}