wpseo_sanitize_tax_meta_<key>

The Yoast SEO wpseo sanitize tax meta key hook.

Description

apply_filters( 'wpseo_sanitize_tax_meta_<key>', (unknown) $clean_key, (null) $meta_data_key, (null) $old_meta_key ); 

Parameters (3)

0. $clean_key (unknown)
The clean key.
1. $meta_data_key (null) => ( isset( $meta_data[ $key ] ) ? $meta_data[ $key ] : null )
The isset meta data key meta data key null.
2. $old_meta_key (null) => ( isset( $old_meta[ $key ] ) ? $old_meta[ $key ] : null )
The isset old meta key old meta key null.

Usage

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

Defined (1)

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

/inc/options/class-wpseo-taxonomy-meta.php  
  1. $clean[ $key ] = apply_filters( 'wpseo_sanitize_tax_meta_' . $key, $clean[ $key ], ( isset( $meta_data[ $key ] ) ? $meta_data[ $key ] : null ), ( isset( $old_meta[ $key ] ) ? $old_meta[ $key ] : null ) );