bp_get_activity_is_favorite()
Return whether the current activity is in a current user’s favorites.
Description
Return
(bool) True if user favorite, false otherwise.
Source
File: bp-activity/bp-activity-template.php
function bp_get_activity_is_favorite() { global $activities_template; /** * Filters whether the current activity item is in the current user's favorites. * * @since BuddyPress 1.2.0 * * @param bool $value Whether or not the current activity item is in the current user's favorites. */ return (bool) apply_filters( 'bp_get_activity_is_favorite', in_array( $activities_template->activity->id, (array) $activities_template->my_favs ) ); }
Changelog
Version | Description |
---|---|
BuddyPress 1.2.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.