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.
- $empty_image = apply_filters( 'bp_blog_latest_post_has_featured_image', $empty_image, $thumbnail, $image );
- if ( !empty( $empty_image ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the bp_blog_latest_post_has_featured_image callback
- function filter_bp_blog_latest_post_has_featured_image( $empty_image, $thumbnail, $image ) {
- // make filter magic happen here...
- return $empty_image;
- };
- // add the filter
- 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.
- // remove the filter
- 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
- return apply_filters( 'bp_blog_latest_post_has_featured_image', ! empty( $image ), $thumbnail, $image );