safe_style_css filter-hook . WP 2.8.1
Filters list of allowed CSS attributes.
Usage
add_filter( 'safe_style_css', 'filter_function_name_2186' ); function filter_function_name_2186( $attr ){ // filter... return $attr; }
- $attr(string[])
- Array of allowed CSS attributes.
Changelog
Since 2.8.1 | Introduced. |
Since 4.4.0 | Added support for min-height, max-height, min-width, and max-width. |
Since 4.6.0 | Added support for list-style-type. |
Since 5.0.0 | Added support for background-image. |
Since 5.1.0 | Added support for text-transform. |
Since 5.2.0 | Added support for background-position and grid-template-columns. |
Since 5.3.0 | Added support for grid, flex and column layout properties. Extend background-* support of individual properties. |
Since 5.3.1 | Added support for gradient backgrounds. |
Where the hook is called
safe_style_css
wp-includes/kses.php 2177-2290
$allowed_attr = apply_filters( 'safe_style_css', array( 'background', 'background-color', 'background-image', 'background-position', 'background-size', 'background-attachment', 'background-blend-mode', 'border', 'border-radius', 'border-width', 'border-color', 'border-style', 'border-right', 'border-right-color', 'border-right-style', 'border-right-width', 'border-bottom', 'border-bottom-color', 'border-bottom-style', 'border-bottom-width', 'border-left', 'border-left-color', 'border-left-style', 'border-left-width', 'border-top', 'border-top-color', 'border-top-style', 'border-top-width', 'border-spacing', 'border-collapse', 'caption-side', 'columns', 'column-count', 'column-fill', 'column-gap', 'column-rule', 'column-span', 'column-width', 'color', 'font', 'font-family', 'font-size', 'font-style', 'font-variant', 'font-weight', 'letter-spacing', 'line-height', 'text-align', 'text-decoration', 'text-indent', 'text-transform', 'height', 'min-height', 'max-height', 'width', 'min-width', 'max-width', 'margin', 'margin-right', 'margin-bottom', 'margin-left', 'margin-top', 'padding', 'padding-right', 'padding-bottom', 'padding-left', 'padding-top', 'flex', 'flex-basis', 'flex-direction', 'flex-flow', 'flex-grow', 'flex-shrink', 'grid-template-columns', 'grid-auto-columns', 'grid-column-start', 'grid-column-end', 'grid-column-gap', 'grid-template-rows', 'grid-auto-rows', 'grid-row-start', 'grid-row-end', 'grid-row-gap', 'grid-gap', 'justify-content', 'justify-items', 'justify-self', 'align-content', 'align-items', 'align-self', 'clear', 'cursor', 'direction', 'float', 'list-style-type', 'overflow', 'vertical-align', ) );