safe_style_css
Filter HookDescription
Filters the list of allowed CSS attributes.Hook Information
File Location |
wp-includes/kses.php
View on GitHub
|
Hook Type | Filter |
Line Number | 2394 |
Hook Parameters
Type | Name | Description |
---|---|---|
string[]
|
$attr
|
Array of allowed CSS attributes. |
Usage Examples
Basic Usage
<?php
// Hook into safe_style_css
add_filter('safe_style_css', 'my_custom_filter', 10, 1);
function my_custom_filter($attr) {
// Your custom filtering logic here
return $attr;
}
Source Code Context
wp-includes/kses.php:2394
- How this hook is used in WordPress core
<?php
2389 *
2390 * @since 2.8.1
2391 *
2392 * @param string[] $attr Array of allowed CSS attributes.
2393 */
2394 $allowed_attr = apply_filters(
2395 'safe_style_css',
2396 array(
2397 'background',
2398 'background-color',
2399 'background-image',
PHP Documentation
<?php
/**
* Filters the list of allowed CSS attributes.
*
* @since 2.8.1
*
* @param string[] $attr Array of allowed CSS attributes.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/kses.php
Related Hooks
Related hooks will be displayed here in future updates.