wpseo_metadesc

Filter: 'wpseo_metadesc' - Allow changing the Yoast SEO meta description sentence.

Description

apply_filters( 'wpseo_metadesc', (unknown) $trim ); 

Parameters (1)

0. $trim (unknown) => trim( $metadesc )
The trim.

Usage

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

Defined (4)

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

/frontend/class-frontend.php  
  1. $this->metadesc = apply_filters( 'wpseo_metadesc', trim( $metadesc ) ); 
/admin/recalculate/class-recalculate-terms.php  
  1. 'meta' => apply_filters( 'wpseo_metadesc', wpseo_replace_vars( $meta, $item ) ), 
/admin/recalculate/class-recalculate-posts.php  
  1. 'meta' => apply_filters( 'wpseo_metadesc', wpseo_replace_vars( $this->get_meta_description( $item->ID, $item->post_type ), $item ) ), 
/admin/class-meta-columns.php  
  1. $metadesc_val = apply_filters( 'wpseo_metadesc', wpseo_replace_vars( WPSEO_Meta::get_value( 'metadesc', $post_id ), get_post( $post_id, ARRAY_A ) ) );