Ticket #6859: 6859.01.patch
File 6859.01.patch, 17.5 KB (added by , 9 years ago) |
---|
-
src/bp-activity/classes/class-bp-activity-component.php
276 276 277 277 // Personal. 278 278 $wp_admin_nav[] = array( 279 'parent' => 'my-account-' . $this->id, 280 'id' => 'my-account-' . $this->id . '-personal', 281 'title' => _x( 'Personal', 'My Account Activity sub nav', 'buddypress' ), 282 'href' => $activity_link 279 'parent' => 'my-account-' . $this->id, 280 'id' => 'my-account-' . $this->id . '-personal', 281 'title' => _x( 'Personal', 'My Account Activity sub nav', 'buddypress' ), 282 'href' => $activity_link, 283 'position' => 10 283 284 ); 284 285 285 286 // Mentions. 286 287 if ( bp_activity_do_mentions() ) { 287 288 $wp_admin_nav[] = array( 288 'parent' => 'my-account-' . $this->id, 289 'id' => 'my-account-' . $this->id . '-mentions', 290 'title' => $title, 291 'href' => trailingslashit( $activity_link . 'mentions' ) 289 'parent' => 'my-account-' . $this->id, 290 'id' => 'my-account-' . $this->id . '-mentions', 291 'title' => $title, 292 'href' => trailingslashit( $activity_link . 'mentions' ), 293 'position' => 20 292 294 ); 293 295 } 294 296 295 297 // Favorite activity items. 296 298 if ( bp_activity_can_favorite() ) { 297 299 $wp_admin_nav[] = array( 298 'parent' => 'my-account-' . $this->id, 299 'id' => 'my-account-' . $this->id . '-favorites', 300 'title' => _x( 'Favorites', 'My Account Activity sub nav', 'buddypress' ), 301 'href' => trailingslashit( $activity_link . 'favorites' ) 300 'parent' => 'my-account-' . $this->id, 301 'id' => 'my-account-' . $this->id . '-favorites', 302 'title' => _x( 'Favorites', 'My Account Activity sub nav', 'buddypress' ), 303 'href' => trailingslashit( $activity_link . 'favorites' ), 304 'position' => 30 302 305 ); 303 306 } 304 307 305 308 // Friends? 306 309 if ( bp_is_active( 'friends' ) ) { 307 310 $wp_admin_nav[] = array( 308 'parent' => 'my-account-' . $this->id, 309 'id' => 'my-account-' . $this->id . '-friends', 310 'title' => _x( 'Friends', 'My Account Activity sub nav', 'buddypress' ), 311 'href' => trailingslashit( $activity_link . bp_get_friends_slug() ) 311 'parent' => 'my-account-' . $this->id, 312 'id' => 'my-account-' . $this->id . '-friends', 313 'title' => _x( 'Friends', 'My Account Activity sub nav', 'buddypress' ), 314 'href' => trailingslashit( $activity_link . bp_get_friends_slug() ), 315 'position' => 40 312 316 ); 313 317 } 314 318 315 319 // Groups? 316 320 if ( bp_is_active( 'groups' ) ) { 317 321 $wp_admin_nav[] = array( 318 'parent' => 'my-account-' . $this->id, 319 'id' => 'my-account-' . $this->id . '-groups', 320 'title' => _x( 'Groups', 'My Account Activity sub nav', 'buddypress' ), 321 'href' => trailingslashit( $activity_link . bp_get_groups_slug() ) 322 'parent' => 'my-account-' . $this->id, 323 'id' => 'my-account-' . $this->id . '-groups', 324 'title' => _x( 'Groups', 'My Account Activity sub nav', 'buddypress' ), 325 'href' => trailingslashit( $activity_link . bp_get_groups_slug() ), 326 'position' => 50 322 327 ); 323 328 } 324 329 } -
src/bp-blogs/classes/class-bp-blogs-component.php
237 237 238 238 // My Sites. 239 239 $wp_admin_nav[] = array( 240 'parent' => 'my-account-' . $this->id, 241 'id' => 'my-account-' . $this->id . '-my-sites', 242 'title' => __( 'My Sites', 'buddypress' ), 243 'href' => $blogs_link 240 'parent' => 'my-account-' . $this->id, 241 'id' => 'my-account-' . $this->id . '-my-sites', 242 'title' => __( 'My Sites', 'buddypress' ), 243 'href' => $blogs_link, 244 'position' => 10 244 245 ); 245 246 246 247 // Create a Site. 247 248 if ( bp_blog_signup_enabled() ) { 248 249 $wp_admin_nav[] = array( 249 'parent' => 'my-account-' . $this->id, 250 'id' => 'my-account-' . $this->id . '-create', 251 'title' => __( 'Create a Site', 'buddypress' ), 252 'href' => trailingslashit( bp_get_blogs_directory_permalink() . 'create' ) 250 'parent' => 'my-account-' . $this->id, 251 'id' => 'my-account-' . $this->id . '-create', 252 'title' => __( 'Create a Site', 'buddypress' ), 253 'href' => trailingslashit( bp_get_blogs_directory_permalink() . 'create' ), 254 'position' => 99 253 255 ); 254 256 } 255 257 } -
src/bp-core/classes/class-bp-component.php
548 548 549 549 // Do we have Toolbar menus to add? 550 550 if ( !empty( $wp_admin_nav ) ) { 551 // Fill in position if one wasn't passed for backpat. 552 $pos = 0; 553 $not_set_pos = 1; 554 foreach( $wp_admin_nav as $key => $nav ) { 555 if ( ! isset( $nav['position'] ) ) { 556 $wp_admin_nav[$key]['position'] = $pos + $not_set_pos; 557 558 if ( 9 !== $not_set_pos ) { 559 ++$not_set_pos; 560 } 561 } else { 562 $pos = $nav['position']; 563 564 // Reset not set pos to 1 565 if ( $pos % 10 === 0 ) { 566 $not_set_pos = 1; 567 } 568 } 569 } 570 571 // Sort admin nav by position. 572 $wp_admin_nav = bp_sort_by_key( $wp_admin_nav, 'position', 'num' ); 551 573 552 574 // Set this objects menus. 553 575 $this->admin_menu = $wp_admin_nav; -
src/bp-friends/classes/class-bp-friends-component.php
203 203 204 204 // My Friends. 205 205 $wp_admin_nav[] = array( 206 'parent' => 'my-account-' . $this->id, 207 'id' => 'my-account-' . $this->id . '-friendships', 208 'title' => _x( 'Friendships', 'My Account Friends menu sub nav', 'buddypress' ), 209 'href' => $friends_link 206 'parent' => 'my-account-' . $this->id, 207 'id' => 'my-account-' . $this->id . '-friendships', 208 'title' => _x( 'Friendships', 'My Account Friends menu sub nav', 'buddypress' ), 209 'href' => $friends_link, 210 'position' => 10 210 211 ); 211 212 212 213 // Requests. 213 214 $wp_admin_nav[] = array( 214 'parent' => 'my-account-' . $this->id, 215 'id' => 'my-account-' . $this->id . '-requests', 216 'title' => $pending, 217 'href' => trailingslashit( $friends_link . 'requests' ) 215 'parent' => 'my-account-' . $this->id, 216 'id' => 'my-account-' . $this->id . '-requests', 217 'title' => $pending, 218 'href' => trailingslashit( $friends_link . 'requests' ), 219 'position' => 20 218 220 ); 219 221 } 220 222 -
src/bp-groups/classes/class-bp-groups-component.php
721 721 722 722 // My Groups. 723 723 $wp_admin_nav[] = array( 724 'parent' => 'my-account-' . $this->id, 725 'id' => 'my-account-' . $this->id . '-memberships', 726 'title' => _x( 'Memberships', 'My Account Groups sub nav', 'buddypress' ), 727 'href' => $groups_link 724 'parent' => 'my-account-' . $this->id, 725 'id' => 'my-account-' . $this->id . '-memberships', 726 'title' => _x( 'Memberships', 'My Account Groups sub nav', 'buddypress' ), 727 'href' => $groups_link, 728 'position' => 10 728 729 ); 729 730 730 731 // Invitations. 731 732 $wp_admin_nav[] = array( 732 'parent' => 'my-account-' . $this->id, 733 'id' => 'my-account-' . $this->id . '-invites', 734 'title' => $pending, 735 'href' => trailingslashit( $groups_link . 'invites' ) 733 'parent' => 'my-account-' . $this->id, 734 'id' => 'my-account-' . $this->id . '-invites', 735 'title' => $pending, 736 'href' => trailingslashit( $groups_link . 'invites' ), 737 'position' => 30 736 738 ); 737 739 738 740 // Create a Group. 739 741 if ( bp_user_can_create_groups() ) { 740 742 $wp_admin_nav[] = array( 741 'parent' => 'my-account-' . $this->id, 742 'id' => 'my-account-' . $this->id . '-create', 743 'title' => _x( 'Create a Group', 'My Account Groups sub nav', 'buddypress' ), 744 'href' => trailingslashit( bp_get_groups_directory_permalink() . 'create' ) 743 'parent' => 'my-account-' . $this->id, 744 'id' => 'my-account-' . $this->id . '-create', 745 'title' => _x( 'Create a Group', 'My Account Groups sub nav', 'buddypress' ), 746 'href' => trailingslashit( bp_get_groups_directory_permalink() . 'create' ), 747 'position' => 90 745 748 ); 746 749 } 747 750 } -
src/bp-messages/classes/class-bp-messages-component.php
253 253 254 254 // Inbox. 255 255 $wp_admin_nav[] = array( 256 'parent' => 'my-account-' . $this->id, 257 'id' => 'my-account-' . $this->id . '-inbox', 258 'title' => $inbox, 259 'href' => $messages_link 256 'parent' => 'my-account-' . $this->id, 257 'id' => 'my-account-' . $this->id . '-inbox', 258 'title' => $inbox, 259 'href' => $messages_link, 260 'position' => 10 260 261 ); 261 262 262 263 // Starred. 263 264 if ( bp_is_active( $this->id, 'star' ) ) { 264 265 $wp_admin_nav[] = array( 265 'parent' => 'my-account-' . $this->id, 266 'id' => 'my-account-' . $this->id . '-starred', 267 'title' => __( 'Starred', 'buddypress' ), 268 'href' => trailingslashit( $messages_link . bp_get_messages_starred_slug() ) 266 'parent' => 'my-account-' . $this->id, 267 'id' => 'my-account-' . $this->id . '-starred', 268 'title' => __( 'Starred', 'buddypress' ), 269 'href' => trailingslashit( $messages_link . bp_get_messages_starred_slug() ), 270 'position' => 11 269 271 ); 270 272 } 271 273 272 274 // Sent Messages. 273 275 $wp_admin_nav[] = array( 274 'parent' => 'my-account-' . $this->id, 275 'id' => 'my-account-' . $this->id . '-sentbox', 276 'title' => __( 'Sent', 'buddypress' ), 277 'href' => trailingslashit( $messages_link . 'sentbox' ) 276 'parent' => 'my-account-' . $this->id, 277 'id' => 'my-account-' . $this->id . '-sentbox', 278 'title' => __( 'Sent', 'buddypress' ), 279 'href' => trailingslashit( $messages_link . 'sentbox' ), 280 'position' => 20 278 281 ); 279 282 280 283 // Compose Message. 281 284 $wp_admin_nav[] = array( 282 'parent' => 'my-account-' . $this->id, 283 'id' => 'my-account-' . $this->id . '-compose', 284 'title' => __( 'Compose', 'buddypress' ), 285 'href' => trailingslashit( $messages_link . 'compose' ) 285 'parent' => 'my-account-' . $this->id, 286 'id' => 'my-account-' . $this->id . '-compose', 287 'title' => __( 'Compose', 'buddypress' ), 288 'href' => trailingslashit( $messages_link . 'compose' ), 289 'position' => 30 286 290 ); 287 291 288 292 // Site Wide Notices. 289 293 if ( bp_current_user_can( 'bp_moderate' ) ) { 290 294 $wp_admin_nav[] = array( 291 'parent' => 'my-account-' . $this->id, 292 'id' => 'my-account-' . $this->id . '-notices', 293 'title' => __( 'All Member Notices', 'buddypress' ), 294 'href' => trailingslashit( $messages_link . 'notices' ) 295 'parent' => 'my-account-' . $this->id, 296 'id' => 'my-account-' . $this->id . '-notices', 297 'title' => __( 'All Member Notices', 'buddypress' ), 298 'href' => trailingslashit( $messages_link . 'notices' ), 299 'position' => 90 295 300 ); 296 301 } 297 302 } -
src/bp-notifications/classes/class-bp-notifications-component.php
202 202 203 203 // Unread. 204 204 $wp_admin_nav[] = array( 205 'parent' => 'my-account-' . $this->id, 206 'id' => 'my-account-' . $this->id . '-unread', 207 'title' => $unread, 208 'href' => $notifications_link 205 'parent' => 'my-account-' . $this->id, 206 'id' => 'my-account-' . $this->id . '-unread', 207 'title' => $unread, 208 'href' => $notifications_link, 209 'position' => 10 209 210 ); 210 211 211 212 // Read. 212 213 $wp_admin_nav[] = array( 213 'parent' => 'my-account-' . $this->id, 214 'id' => 'my-account-' . $this->id . '-read', 215 'title' => _x( 'Read', 'My Account Notification sub nav', 'buddypress' ), 216 'href' => trailingslashit( $notifications_link . 'read' ), 214 'parent' => 'my-account-' . $this->id, 215 'id' => 'my-account-' . $this->id . '-read', 216 'title' => _x( 'Read', 'My Account Notification sub nav', 'buddypress' ), 217 'href' => trailingslashit( $notifications_link . 'read' ), 218 'position' => 20 217 219 ); 218 220 } 219 221 -
src/bp-settings/classes/class-bp-settings-component.php
183 183 184 184 // General Account. 185 185 $wp_admin_nav[] = array( 186 'parent' => 'my-account-' . $this->id, 187 'id' => 'my-account-' . $this->id . '-general', 188 'title' => __( 'General', 'buddypress' ), 189 'href' => $settings_link 186 'parent' => 'my-account-' . $this->id, 187 'id' => 'my-account-' . $this->id . '-general', 188 'title' => __( 'General', 'buddypress' ), 189 'href' => $settings_link, 190 'position' => 10 190 191 ); 191 192 192 193 // Notifications - only add the tab when there is something to display there. 193 194 if ( has_action( 'bp_notification_settings' ) ) { 194 195 $wp_admin_nav[] = array( 195 'parent' => 'my-account-' . $this->id, 196 'id' => 'my-account-' . $this->id . '-notifications', 197 'title' => __( 'Email', 'buddypress' ), 198 'href' => trailingslashit( $settings_link . 'notifications' ) 196 'parent' => 'my-account-' . $this->id, 197 'id' => 'my-account-' . $this->id . '-notifications', 198 'title' => __( 'Email', 'buddypress' ), 199 'href' => trailingslashit( $settings_link . 'notifications' ), 200 'position' => 20 199 201 ); 200 202 } 201 203 202 // Delete Account .203 if ( !bp_current_user_can( 'bp_moderate' ) && ! bp_core_get_root_option( 'bp-disable-account-deletion' ) ) {204 // Delete Account 205 if ( !bp_current_user_can( 'bp_moderate' ) && ! bp_core_get_root_option( 'bp-disable-account-deletion' ) ) 204 206 $wp_admin_nav[] = array( 205 'parent' => 'my-account-' . $this->id, 206 'id' => 'my-account-' . $this->id . '-delete-account', 207 'title' => __( 'Delete Account', 'buddypress' ), 208 'href' => trailingslashit( $settings_link . 'delete-account' ) 207 'parent' => 'my-account-' . $this->id, 208 'id' => 'my-account-' . $this->id . '-delete-account', 209 'title' => __( 'Delete Account', 'buddypress' ), 210 'href' => trailingslashit( $settings_link . 'delete-account' ), 211 'position' => 90 209 212 ); 210 213 } 211 214 } -
src/bp-xprofile/classes/class-bp-xprofile-component.php
318 318 319 319 // View Profile. 320 320 $wp_admin_nav[] = array( 321 'parent' => 'my-account-' . $this->id, 322 'id' => 'my-account-' . $this->id . '-public', 323 'title' => _x( 'View', 'My Account Profile sub nav', 'buddypress' ), 324 'href' => $profile_link 321 'parent' => 'my-account-' . $this->id, 322 'id' => 'my-account-' . $this->id . '-public', 323 'title' => _x( 'View', 'My Account Profile sub nav', 'buddypress' ), 324 'href' => $profile_link, 325 'position' => 10 325 326 ); 326 327 327 328 // Edit Profile. 328 329 $wp_admin_nav[] = array( 329 'parent' => 'my-account-' . $this->id, 330 'id' => 'my-account-' . $this->id . '-edit', 331 'title' => _x( 'Edit', 'My Account Profile sub nav', 'buddypress' ), 332 'href' => trailingslashit( $profile_link . 'edit' ) 330 'parent' => 'my-account-' . $this->id, 331 'id' => 'my-account-' . $this->id . '-edit', 332 'title' => _x( 'Edit', 'My Account Profile sub nav', 'buddypress' ), 333 'href' => trailingslashit( $profile_link . 'edit' ), 334 'position' => 20 333 335 ); 334 336 335 337 // Edit Avatar. 336 338 if ( buddypress()->avatar->show_avatars ) { 337 339 $wp_admin_nav[] = array( 338 'parent' => 'my-account-' . $this->id, 339 'id' => 'my-account-' . $this->id . '-change-avatar', 340 'title' => _x( 'Change Profile Photo', 'My Account Profile sub nav', 'buddypress' ), 341 'href' => trailingslashit( $profile_link . 'change-avatar' ) 340 'parent' => 'my-account-' . $this->id, 341 'id' => 'my-account-' . $this->id . '-change-avatar', 342 'title' => _x( 'Change Profile Photo', 'My Account Profile sub nav', 'buddypress' ), 343 'href' => trailingslashit( $profile_link . 'change-avatar' ), 344 'position' => 30 342 345 ); 343 346 } 344 347 345 348 if ( bp_displayed_user_use_cover_image_header() ) { 346 349 $wp_admin_nav[] = array( 347 'parent' => 'my-account-' . $this->id, 348 'id' => 'my-account-' . $this->id . '-change-cover-image', 349 'title' => _x( 'Change Cover Image', 'My Account Profile sub nav', 'buddypress' ), 350 'href' => trailingslashit( $profile_link . 'change-cover-image' ) 350 'parent' => 'my-account-' . $this->id, 351 'id' => 'my-account-' . $this->id . '-change-cover-image', 352 'title' => _x( 'Change Cover Image', 'My Account Profile sub nav', 'buddypress' ), 353 'href' => trailingslashit( $profile_link . 'change-cover-image' ), 354 'position' => 40 351 355 ); 352 356 } 353 357 }