bp_activity_action_favorites_feed
Load a user's favorites feed.
Description
bp_activity_action_favorites_feed();
Usage
if ( !function_exists( 'bp_activity_action_favorites_feed' ) ) { require_once ABSPATH . PLUGINDIR . 'buddypress/bp-activity/bp-activity-actions.php'; } // NOTICE! Understand what this does before running. $result = bp_activity_action_favorites_feed();
Defined (1)
The function is defined in the following location(s).
- /bp-activity/bp-activity-actions.php
- function bp_activity_action_favorites_feed() {
- if ( ! bp_is_user_activity() || ! bp_is_current_action( 'favorites' ) || ! bp_is_action_variable( 'feed', 0 ) ) {
- return false;
- }
- // Get displayed user's favorite activity IDs.
- $favs = bp_activity_get_user_favorites( bp_displayed_user_id() );
- $fav_ids = implode( ', ', (array) $favs );
- // Setup the feed.
- buddypress)->activity->feed = new BP_Activity_Feed( array(
- 'id' => 'favorites',
- /** translators: User activity favorites RSS title - "[Site Name] | [User Display Name] | Favorites" */
- 'title' => sprintf( __( '%1$s | %2$s | Favorites', buddypress ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
- 'link' => bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/',
- 'description' => sprintf( __( "Activity feed of %s's favorites.", buddypress ), bp_get_displayed_user_fullname() ),
- 'activity_args' => 'include=' . $fav_ids
- ) );
- }