bp_blog_latest_post_has_featured_image

Does the latest blog post have a featured image?.

Description

bp_blog_latest_post_has_featured_image( (string) $thumbnail = 'thumbnail' ); 

Parameters (1)

0. $thumbnail — Optional. (string) => 'thumbnail'
Image version to return. thumbnail,, medium., large, or post-thumbnail. Default: thumbnail,.

Usage

  1. if ( !function_exists( 'bp_blog_latest_post_has_featured_image' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-blogs/bp-blogs-template.php'; 
  3.  
  4. // Image version to return. 'thumbnail', 'medium', 'large', 
  5. // or 'post-thumbnail'. Default: 'thumbnail'. 
  6. $thumbnail = 'thumbnail'; 
  7.  
  8. // NOTICE! Understand what this does before running. 
  9. $result = bp_blog_latest_post_has_featured_image($thumbnail); 
  10.  

Defined (1)

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

/bp-blogs/bp-blogs-template.php  
  1. function bp_blog_latest_post_has_featured_image( $thumbnail = 'thumbnail' ) { 
  2. $image = bp_get_blog_latest_post_featured_image( $thumbnail ); 
  3.  
  4. /** 
  5. * Filters whether or not the latest blog post has a featured image. 
  6. * @since 1.7.0 
  7. * @param bool $value Whether or not the latest blog post has a featured image. 
  8. * @param string $thumbnail Image version to return. 
  9. * @param string $image Returned value from bp_get_blog_latest_post_featured_image. 
  10. */ 
  11. return apply_filters( 'bp_blog_latest_post_has_featured_image', ! empty( $image ), $thumbnail, $image );