bp_get_blog_latest_post_featured_image( string $size = 'thumbnail' )
Return the featured image of the latest post on the current blog in the loop.
Description
Parameters
- $size
-
(Optional) Image version to return. 'thumbnail', 'medium', 'large', or 'post-thumbnail'. Default: 'thumbnail'.
Default value: 'thumbnail'
Return
(string) URL of the image.
Source
File: bp-blogs/bp-blogs-template.php
869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 | function bp_get_blog_latest_post_featured_image( $size = 'thumbnail' ) { global $blogs_template ; $retval = '' ; if ( ! empty ( $blogs_template ->blog->latest_post ) && ! empty ( $blogs_template ->blog->latest_post->images[ $size ] ) ) $retval = $blogs_template ->blog->latest_post->images[ $size ]; /** * Filters the featured image of the latest post on the current blog in the loop. * * @since BuddyPress 1.7.0 * * @param string $retval The featured image of the latest post on the current blog in the loop. */ return apply_filters( 'bp_get_blog_latest_post_featured_image' , $retval ); } |
Changelog
Version | Description |
---|---|
BuddyPress 1.7.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.