wpseo_sanitize_post_meta_<meta_key>

The Yoast SEO wpseo sanitize post meta key hook.

Description

apply_filters( 'wpseo_sanitize_post_meta_<meta_key>', (unknown) $clean, (unknown) $meta_value, (unknown) $field_def, (unknown) $meta_key ); 

Parameters (4)

0. $clean (unknown)
The clean.
1. $meta_value (unknown)
The meta value.
2. $field_def (unknown)
The field def.
3. $meta_key (unknown)
The meta key.

Usage

To run the hook, copy the example below.
  1. $clean = apply_filters( 'wpseo_sanitize_post_meta_{$meta_key}', $clean, $meta_value, $field_def, $meta_key ); 
  2.  
  3. if ( !empty( $clean ) ) { 
  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_post_meta_<meta_key> callback 
  2. function filter_wpseo_sanitize_post_meta_meta_key( $clean, $meta_value, $field_def, $meta_key ) { 
  3. // make filter magic happen here... 
  4. return $clean
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( "wpseo_sanitize_post_meta_{$meta_key}", 'filter_wpseo_sanitize_post_meta_meta_key', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( "wpseo_sanitize_post_meta_{$meta_key}", 'filter_wpseo_sanitize_post_meta_meta_key', 10, 4 ); 

Defined (1)

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

/inc/class-wpseo-meta.php  
  1. $clean = apply_filters( 'wpseo_sanitize_post_meta_' . $meta_key, $clean, $meta_value, $field_def, $meta_key );