Changeset 10253 for trunk/src/bp-activity/bp-activity-loader.php
- Timestamp:
- 10/12/2015 05:45:14 AM (10 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-activity/bp-activity-loader.php (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-loader.php
r10110 r10253 9 9 */ 10 10 11 // Exit if accessed directly 11 // Exit if accessed directly. 12 12 defined( 'ABSPATH' ) || exit; 13 13 … … 47 47 public function includes( $includes = array() ) { 48 48 49 // Files to include 49 // Files to include. 50 50 $includes = array( 51 51 'cssjs', … … 60 60 ); 61 61 62 // Load Akismet support if Akismet is configured 62 // Load Akismet support if Akismet is configured. 63 63 $akismet_key = bp_get_option( 'wordpress_api_key' ); 64 64 … … 90 90 $bp = buddypress(); 91 91 92 // Define a slug, if necessary 92 // Define a slug, if necessary. 93 93 if ( ! defined( 'BP_ACTIVITY_SLUG' ) ) { 94 94 define( 'BP_ACTIVITY_SLUG', $this->id ); 95 95 } 96 96 97 // Global tables for activity component 97 // Global tables for activity component. 98 98 $global_tables = array( 99 99 'table_name' => $bp->table_prefix . 'bp_activity', … … 101 101 ); 102 102 103 // Metadata tables for groups component 103 // Metadata tables for groups component. 104 104 $meta_tables = array( 105 105 'activity' => $bp->table_prefix . 'bp_activity_meta', … … 138 138 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { 139 139 140 // Stop if there is no user displayed or logged in 140 // Stop if there is no user displayed or logged in. 141 141 if ( ! is_user_logged_in() && ! bp_displayed_user_id() ) { 142 142 return; 143 143 } 144 144 145 // Determine user to use 145 // Determine user to use. 146 146 if ( bp_displayed_user_domain() ) { 147 147 $user_domain = bp_displayed_user_domain(); … … 155 155 $activity_link = trailingslashit( $user_domain . $slug ); 156 156 157 // Add 'Activity' to the main navigation 157 // Add 'Activity' to the main navigation. 158 158 $main_nav = array( 159 159 'name' => _x( 'Activity', 'Profile activity screen nav', 'buddypress' ), … … 165 165 ); 166 166 167 // Add the subnav items to the activity nav item if we are using a theme that supports this 167 // Add the subnav items to the activity nav item if we are using a theme that supports this. 168 168 $sub_nav[] = array( 169 169 'name' => _x( 'Personal', 'Profile activity screen sub nav', 'buddypress' ), … … 175 175 ); 176 176 177 // @ mentions177 // Check @mentions. 178 178 if ( bp_activity_do_mentions() ) { 179 179 $sub_nav[] = array( … … 188 188 } 189 189 190 // Favorite activity items 190 // Favorite activity items. 191 191 if ( bp_activity_can_favorite() ) { 192 192 $sub_nav[] = array( … … 201 201 } 202 202 203 // Additional menu if friends is active 203 // Additional menu if friends is active. 204 204 if ( bp_is_active( 'friends' ) ) { 205 205 $sub_nav[] = array( … … 214 214 } 215 215 216 // Additional menu if groups is active 216 // Additional menu if groups is active. 217 217 if ( bp_is_active( 'groups' ) ) { 218 218 $sub_nav[] = array( … … 250 250 public function setup_admin_bar( $wp_admin_nav = array() ) { 251 251 252 // Menus for logged in user 252 // Menus for logged in user. 253 253 if ( is_user_logged_in() ) { 254 254 255 // Setup the logged in user variables 255 // Setup the logged in user variables. 256 256 $activity_link = trailingslashit( bp_loggedin_user_domain() . bp_get_activity_slug() ); 257 257 258 // Unread message count 258 // Unread message count. 259 259 if ( bp_activity_do_mentions() ) { 260 260 $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() ); … … 266 266 } 267 267 268 // Add the "Activity" sub menu 268 // Add the "Activity" sub menu. 269 269 $wp_admin_nav[] = array( 270 270 'parent' => buddypress()->my_account_menu_id, … … 274 274 ); 275 275 276 // Personal 276 // Personal. 277 277 $wp_admin_nav[] = array( 278 278 'parent' => 'my-account-' . $this->id, … … 282 282 ); 283 283 284 // Mentions 284 // Mentions. 285 285 if ( bp_activity_do_mentions() ) { 286 286 $wp_admin_nav[] = array( … … 292 292 } 293 293 294 // Favorites 295 // Favorite activity items 294 // Favorite activity items. 296 295 if ( bp_activity_can_favorite() ) { 297 296 $wp_admin_nav[] = array( … … 338 337 public function setup_title() { 339 338 340 // Adjust title based on view 339 // Adjust title based on view. 341 340 if ( bp_is_activity_component() ) { 342 341 $bp = buddypress(); … … 364 363 public function setup_actions() { 365 364 366 // Spam prevention 365 // Spam prevention. 367 366 add_action( 'bp_include', 'bp_activity_setup_akismet' ); 368 367 … … 377 376 public function setup_cache_groups() { 378 377 379 // Global groups 378 // Global groups. 380 379 wp_cache_add_global_groups( array( 381 380 'bp_activity',
Note: See TracChangeset
for help on using the changeset viewer.