Changeset 12907 for trunk/src/bp-activity/actions/feeds.php
- Timestamp:
- 04/27/2021 04:56:32 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/actions/feeds.php
r12586 r12907 18 18 $bp = buddypress(); 19 19 20 if ( ! bp_is_activity_component() || ! bp_is_current_action( 'feed' ) || bp_is_user() || ! empty( $bp->groups->current_group ) ) 21 return false; 20 if ( ! bp_is_activity_component() || ! bp_is_current_action( 'feed' ) || bp_is_user() || ! empty( $bp->groups->current_group ) ) { 21 return false; 22 } 23 24 $link = bp_get_activity_directory_permalink(); 22 25 23 26 // Setup the feed. … … 27 30 /* translators: %s Site Name */ 28 31 'title' => sprintf( __( '%s | Site-Wide Activity', 'buddypress' ), bp_get_site_name() ), 29 'link' => bp_get_activity_directory_permalink(),32 'link' => $link, 30 33 'description' => __( 'Activity feed for the entire site.', 'buddypress' ), 31 34 'activity_args' => 'display_comments=threaded' 32 35 ) ); 36 37 if ( ! buddypress()->activity->feed->enabled ) { 38 bp_core_redirect( $link ); 39 } 33 40 } 34 41 add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' ); … … 46 53 } 47 54 55 $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() ); 56 48 57 // Setup the feed. 49 58 buddypress()->activity->feed = new BP_Activity_Feed( array( … … 52 61 /* translators: 1: Site Name. 2: User Display Name. */ 53 62 'title' => sprintf( _x( '%1$s | %2$s | Activity', 'Personal activity feed title', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 54 'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() ),63 'link' => $link, 55 64 56 65 /* translators: %s: User Display Name */ … … 58 67 'activity_args' => 'user_id=' . bp_displayed_user_id() 59 68 ) ); 69 70 if ( ! buddypress()->activity->feed->enabled ) { 71 bp_core_redirect( $link ); 72 } 60 73 } 61 74 add_action( 'bp_actions', 'bp_activity_action_personal_feed' ); … … 73 86 } 74 87 88 $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() ); 89 75 90 // Setup the feed. 76 91 buddypress()->activity->feed = new BP_Activity_Feed( array( … … 79 94 /* translators: 1: Site Name 2: User Display Name */ 80 95 'title' => sprintf( __( '%1$s | %2$s | Friends Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 81 'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() ),96 'link' => $link, 82 97 83 98 /* translators: %s: User Display Name */ … … 85 100 'activity_args' => 'scope=friends' 86 101 ) ); 102 103 if ( ! buddypress()->activity->feed->enabled ) { 104 bp_core_redirect( $link ); 105 } 87 106 } 88 107 add_action( 'bp_actions', 'bp_activity_action_friends_feed' ); … … 103 122 $groups = groups_get_user_groups(); 104 123 $group_ids = implode( ',', $groups['groups'] ); 124 $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() ); 105 125 106 126 // Setup the feed. … … 110 130 /* translators: 1: Site Name 2: User Display Name */ 111 131 'title' => sprintf( __( '%1$s | %2$s | Group Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 112 'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() ),132 'link' => $link, 113 133 114 134 /* translators: %s: User Display Name */ … … 120 140 ) 121 141 ) ); 142 143 if ( ! buddypress()->activity->feed->enabled ) { 144 bp_core_redirect( $link ); 145 } 122 146 } 123 147 add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' ); … … 135 159 } 136 160 137 if ( !bp_is_user_activity() || ! bp_is_current_action( 'mentions' ) || ! bp_is_action_variable( 'feed', 0 ) ) { 138 return false; 139 } 161 if ( ! bp_is_user_activity() || ! bp_is_current_action( 'mentions' ) || ! bp_is_action_variable( 'feed', 0 ) ) { 162 return false; 163 } 164 165 $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions' ); 140 166 141 167 // Setup the feed. … … 145 171 /* translators: 1: Site Name 2: User Display Name */ 146 172 'title' => sprintf( __( '%1$s | %2$s | Mentions', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 147 'link' => bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions/',173 'link' => $link, 148 174 149 175 /* translators: %s: User Display Name */ … … 153 179 ) 154 180 ) ); 181 182 if ( ! buddypress()->activity->feed->enabled ) { 183 bp_core_redirect( $link ); 184 } 155 185 } 156 186 add_action( 'bp_actions', 'bp_activity_action_mentions_feed' ); … … 169 199 170 200 // Get displayed user's favorite activity IDs. 171 $favs = bp_activity_get_user_favorites( bp_displayed_user_id() );201 $favs = bp_activity_get_user_favorites( bp_displayed_user_id() ); 172 202 $fav_ids = implode( ',', (array) $favs ); 203 $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites' ); 173 204 174 205 // Setup the feed. … … 178 209 /* translators: 1: Site Name 2: User Display Name */ 179 210 'title' => sprintf( __( '%1$s | %2$s | Favorites', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 180 'link' => bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/',211 'link' => $link, 181 212 182 213 /* translators: %s: User Display Name */ … … 184 215 'activity_args' => 'include=' . $fav_ids 185 216 ) ); 217 218 if ( ! buddypress()->activity->feed->enabled ) { 219 bp_core_redirect( $link ); 220 } 186 221 } 187 222 add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
Note: See TracChangeset
for help on using the changeset viewer.