bp_blog_latest_post_has_featured_image

Filters whether or not the latest blog post has a featured image.

Description

apply_filters( 'bp_blog_latest_post_has_featured_image', (bool) $empty_image, (string) $thumbnail, (string) $image ); 

Parameters (3)

0. $empty_image (bool) => ! empty( $image )
Whether or not the latest blog post has a featured image.
1. $thumbnail (string)
Image version to return.
2. $image (string)
Returned value from bp_get_blog_latest_post_featured_image.

Usage

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

Defined (1)

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

/bp-blogs/bp-blogs-template.php  
  1. return apply_filters( 'bp_blog_latest_post_has_featured_image', ! empty( $image ), $thumbnail, $image );