bp_get_blog_latest_post_featured_image

Return the featured image of the latest post on the current blog in the loop.

Description

(string) bp_get_blog_latest_post_featured_image( (string) $size = 'thumbnail' ); 

Returns (string)

URL of the image.

Parameters (1)

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

Usage

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

Defined (1)

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

/bp-blogs/bp-blogs-template.php  
  1. function bp_get_blog_latest_post_featured_image( $size = 'thumbnail' ) { 
  2. global $blogs_template; 
  3.  
  4. $retval = ''; 
  5.  
  6. if ( ! empty( $blogs_template->blog->latest_post ) && ! empty( $blogs_template->blog->latest_post->images[$size] ) ) 
  7. $retval = $blogs_template->blog->latest_post->images[$size]; 
  8.  
  9. /** 
  10. * Filters the featured image of the latest post on the current blog in the loop. 
  11. * @since 1.7.0 
  12. * @param string $retval The featured image of the latest post on the current blog in the loop. 
  13. */