wpseo_post_content_for_recalculation

Filter the post content for use in the SEO score recalculation.

Description

apply_filters( 'wpseo_post_content_for_recalculation', (string) $content, (WP_Post) $item ); 

Parameters (2)

0. $content (string)
Content of the post. Modify to reflect front-end content.
1. $item (WP_Post)
The Post object the content comes from.

Usage

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

Defined (1)

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

/admin/recalculate/class-recalculate-posts.php  
  1. $content = apply_filters( 'wpseo_post_content_for_recalculation', $content, $item );