safe_style_css

Filters list of allowed CSS attributes.

Description

apply_filters( 'safe_style_css', (callback) $array ); 

Parameters (1)

0. $array (callback) => array( 'background', 'background-color','border', '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','color', 'font', 'font-family', 'font-size', 'font-style', 'font-variant', 'font-weight', 'letter-spacing', 'line-height', 'text-decoration', 'text-indent', 'text-align','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','clear', 'cursor', 'direction', 'float', 'overflow', 'vertical-align', 'list-style-type', )
List of allowed CSS attributes.

Usage

To run the hook, copy the example below.
  1. $array = apply_filters( 'safe_style_css', $array ); 
  2.  
  3. if ( !empty( $array ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the safe_style_css callback 
  2. function filter_safe_style_css( $array ) { 
  3. // make filter magic happen here... 
  4. return $array
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'safe_style_css', 'filter_safe_style_css', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'safe_style_css', 'filter_safe_style_css', 10, 1 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/kses.php  
  1. $allowed_attr = apply_filters( 'safe_style_css', array(