Changeset 12893
- Timestamp:
- 04/19/2021 04:25:39 AM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 2 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-notifications.php
r12586 r12893 20 20 * @param int $secondary_item_id In the case of at-mentions, this is the mentioner's ID. 21 21 * @param int $total_items The total number of notifications to format. 22 * @param string $format 'string' to get a BuddyBar-compatible notification, 'array' otherwise.22 * @param string $format 'string' for notification HTML link or 'array' for separate link and text. 23 23 * @param int $id Optional. The notification ID. 24 24 * @return string $return Formatted @mention notification. -
trunk/src/bp-core/bp-core-adminbar.php
r12495 r12893 45 45 46 46 /** 47 * Handle the Toolbar/BuddyBar business.47 * Toggle the display of the toolbar based on certain conditions. 48 48 * 49 49 * @since 1.2.0 50 50 */ 51 51 function bp_core_load_admin_bar() { 52 53 52 // Show the Toolbar for logged out users. 54 53 if ( ! is_user_logged_in() && (int) bp_get_option( 'hide-loggedout-adminbar' ) != 1 ) { … … 56 55 } 57 56 58 // Hide the WordPress Toolbar and show the BuddyBar.57 // Hide the WordPress Toolbar. 59 58 if ( ! bp_use_wp_admin_bar() ) { 60 _doing_it_wrong( __FUNCTION__, __( 'The BuddyBar is no longer supported. Please migrate to the WordPress toolbar as soon as possible.', 'buddypress' ), '2.1.0' );61 62 // Load deprecated code if not available.63 if ( ! function_exists( 'bp_core_admin_bar' ) ) {64 require buddypress()->plugin_dir . 'bp-core/deprecated/2.1.php';65 }66 67 59 // Keep the WP Toolbar from loading. 68 60 show_admin_bar( false ); 69 70 // Actions used to build the BP Toolbar.71 add_action( 'bp_adminbar_logo', 'bp_adminbar_logo' );72 add_action( 'bp_adminbar_menus', 'bp_adminbar_login_menu', 2 );73 add_action( 'bp_adminbar_menus', 'bp_adminbar_account_menu', 4 );74 add_action( 'bp_adminbar_menus', 'bp_adminbar_thisblog_menu', 6 );75 add_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu', 100 );76 77 // Actions used to append BP Toolbar to footer.78 add_action( 'wp_footer', 'bp_core_admin_bar', 8 );79 add_action( 'admin_footer', 'bp_core_admin_bar' );80 61 } 81 62 } -
trunk/src/bp-core/bp-core-buddybar.php
r12288 r12893 6 6 * @subpackage Core 7 7 * @since 1.5.0 8 *9 * @todo Deprecate BuddyBar functions.10 8 */ 11 9 -
trunk/src/bp-core/bp-core-functions.php
r12892 r12893 434 434 function bp_use_wp_admin_bar() { 435 435 436 // Default to true (to avoid loading deprecated BuddyBar code).436 // Default to true. 437 437 $use_admin_bar = true; 438 438 … … 440 440 if ( defined( 'BP_USE_WP_ADMIN_BAR' ) ) { 441 441 $use_admin_bar = (bool) BP_USE_WP_ADMIN_BAR; 442 443 // ...or is the old BuddyBar being forced back into use?444 } elseif ( bp_force_buddybar( false ) ) {445 $use_admin_bar = false;446 442 } 447 443 -
trunk/src/bp-core/bp-core-options.php
r11939 r12893 90 90 // HeartBeat is on to refresh activities. 91 91 '_bp_enable_heartbeat_refresh' => true, 92 93 /* BuddyBar **********************************************************/94 95 // Force the BuddyBar.96 '_bp_force_buddybar' => false,97 92 98 93 /* Legacy *********************************************/ … … 669 664 670 665 /** 671 * Should the old BuddyBar be forced in place of the WP admin bar?672 *673 * @since 1.6.0674 *675 * @param bool $default Optional. Fallback value if not found in the database.676 * Default: true.677 * @return bool True if the BuddyBar should be forced on, otherwise false.678 */679 function bp_force_buddybar( $default = true ) {680 681 /**682 * Filters whether or not BuddyBar should be forced in place of WP Admin Bar.683 *684 * @since 1.6.0685 *686 * @param bool $value Whether or not BuddyBar should be forced in place of WP Admin Bar.687 */688 return (bool) apply_filters( 'bp_force_buddybar', (bool) bp_get_option( '_bp_force_buddybar', $default ) );689 }690 691 /**692 666 * Check whether Akismet is enabled. 693 667 * -
trunk/src/bp-core/classes/class-bp-admin.php
r12815 r12893 378 378 add_settings_field( 'hide-loggedout-adminbar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_admin_bar', 'buddypress', 'bp_main' ); 379 379 register_setting( 'buddypress', 'hide-loggedout-adminbar', 'intval' ); 380 381 // Only show 'switch to Toolbar' option if the user chose to retain the BuddyBar during the 1.6 upgrade.382 if ( (bool) bp_get_option( '_bp_force_buddybar', false ) ) {383 // Load deprecated code if not available.384 if ( ! function_exists( 'bp_admin_setting_callback_force_buddybar' ) ) {385 require buddypress()->plugin_dir . 'bp-core/deprecated/2.1.php';386 }387 388 add_settings_field( '_bp_force_buddybar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_force_buddybar', 'buddypress', 'bp_main' );389 register_setting( 'buddypress', '_bp_force_buddybar', 'bp_admin_sanitize_callback_force_buddybar' );390 }391 380 392 381 // Allow account deletion. -
trunk/src/bp-core/deprecated/2.1.php
r12588 r12893 40 40 */ 41 41 function bp_adminbar_blogs_menu() { 42 43 if ( ! is_user_logged_in() || ! bp_is_active( 'blogs' ) ) {44 return false;45 }46 47 if ( ! is_multisite() ) {48 return false;49 }50 51 $blogs = wp_cache_get( 'bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', 'bp' );52 if ( empty( $blogs ) ) {53 $blogs = bp_blogs_get_blogs_for_user( bp_loggedin_user_id(), true );54 wp_cache_set( 'bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', $blogs, 'bp' );55 }56 57 $counter = 0;58 if ( is_array( $blogs['blogs'] ) && (int) $blogs['count'] ) {59 60 echo '<li id="bp-adminbar-blogs-menu"><a href="' . trailingslashit( bp_loggedin_user_domain() . bp_get_blogs_slug() ) . '">';61 62 _e( 'My Sites', 'buddypress' );63 64 echo '</a>';65 echo '<ul>';66 67 foreach ( (array) $blogs['blogs'] as $blog ) {68 $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';69 $site_url = esc_attr( $blog->siteurl );70 71 echo '<li' . $alt . '>';72 echo '<a href="' . $site_url . '">' . esc_html( $blog->name ) . '</a>';73 echo '<ul>';74 echo '<li class="alt"><a href="' . $site_url . 'wp-admin/">' . __( 'Dashboard', 'buddypress' ) . '</a></li>';75 echo '<li><a href="' . $site_url . 'wp-admin/post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';76 echo '<li class="alt"><a href="' . $site_url . 'wp-admin/edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';77 echo '<li><a href="' . $site_url . 'wp-admin/edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';78 echo '</ul>';79 80 do_action( 'bp_adminbar_blog_items', $blog );81 82 echo '</li>';83 $counter++;84 }85 86 $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';87 88 if ( bp_blog_signup_enabled() ) {89 echo '<li' . $alt . '>';90 echo '<a href="' . trailingslashit( bp_get_blogs_directory_permalink() . 'create' ) . '">' . __( 'Create a Site!', 'buddypress' ) . '</a>';91 echo '</li>';92 }93 94 echo '</ul>';95 echo '</li>';96 }97 42 } 98 43 … … 105 50 */ 106 51 function bp_admin_setting_callback_force_buddybar() { 107 ?>108 109 <input id="_bp_force_buddybar" name="_bp_force_buddybar" type="checkbox" value="1" <?php checked( ! bp_force_buddybar( true ) ); ?> />110 <label for="_bp_force_buddybar"><?php _e( 'Switch to WordPress Toolbar', 'buddypress' ); ?></label>111 112 <?php113 52 } 114 53 … … 136 75 */ 137 76 function bp_core_admin_bar() { 138 $bp = buddypress();139 140 if ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) {141 return false;142 }143 144 if ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) {145 return false;146 }147 148 $bp->doing_admin_bar = true;149 150 echo '<div id="wp-admin-bar"><div class="padder">';151 152 // **** Do bp-adminbar-logo Actions ********153 do_action( 'bp_adminbar_logo' );154 155 echo '<ul class="main-nav">';156 157 // **** Do bp-adminbar-menus Actions ********158 do_action( 'bp_adminbar_menus' );159 160 echo '</ul>';161 echo "</div></div><!-- #wp-admin-bar -->\n\n";162 163 $bp->doing_admin_bar = false;164 77 } 165 78 … … 170 83 */ 171 84 function bp_adminbar_logo() { 172 echo '<a href="' . bp_get_root_domain() . '" id="admin-bar-logo">' . get_blog_option( bp_get_root_blog_id(), 'blogname' ) . '</a>';173 85 } 174 86 … … 183 95 */ 184 96 function bp_adminbar_login_menu() { 185 186 if ( is_user_logged_in() ) {187 return false;188 }189 190 echo '<li class="bp-login no-arrow"><a href="' . wp_login_url() . '">' . __( 'Log In', 'buddypress' ) . '</a></li>';191 192 // Show "Sign Up" link if user registrations are allowed.193 if ( bp_get_signup_allowed() ) {194 echo '<li class="bp-signup no-arrow"><a href="' . bp_get_signup_page() . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>';195 }196 97 } 197 98 … … 204 105 */ 205 106 function bp_adminbar_account_menu() { 206 $bp = buddypress();207 208 if ( empty( $bp->bp_nav ) || ! is_user_logged_in() ) {209 return false;210 }211 212 echo '<li id="bp-adminbar-account-menu"><a href="' . bp_loggedin_user_domain() . '">';213 echo __( 'My Account', 'buddypress' ) . '</a>';214 echo '<ul>';215 216 // Loop through each navigation item.217 $counter = 0;218 foreach( (array) $bp->bp_nav as $nav_item ) {219 $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';220 221 if ( -1 == $nav_item['position'] ) {222 continue;223 }224 225 echo '<li' . $alt . '>';226 echo '<a id="bp-admin-' . $nav_item['css_id'] . '" href="' . $nav_item['link'] . '">' . $nav_item['name'] . '</a>';227 228 if ( isset( $bp->bp_options_nav[$nav_item['slug']] ) && is_array( $bp->bp_options_nav[$nav_item['slug']] ) ) {229 echo '<ul>';230 $sub_counter = 0;231 232 foreach( (array) $bp->bp_options_nav[$nav_item['slug']] as $subnav_item ) {233 $link = $subnav_item['link'];234 $name = $subnav_item['name'];235 236 if ( bp_displayed_user_domain() ) {237 $link = str_replace( bp_displayed_user_domain(), bp_loggedin_user_domain(), $subnav_item['link'] );238 }239 240 if ( isset( $bp->displayed_user->userdata->user_login ) ) {241 $name = str_replace( $bp->displayed_user->userdata->user_login, $bp->loggedin_user->userdata->user_login, $subnav_item['name'] );242 }243 244 $alt = ( 0 == $sub_counter % 2 ) ? ' class="alt"' : '';245 echo '<li' . $alt . '><a id="bp-admin-' . $subnav_item['css_id'] . '" href="' . $link . '">' . $name . '</a></li>';246 $sub_counter++;247 }248 echo '</ul>';249 }250 251 echo '</li>';252 253 $counter++;254 }255 256 $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';257 258 echo '<li' . $alt . '><a id="bp-admin-logout" class="logout" href="' . wp_logout_url( home_url() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';259 echo '</ul>';260 echo '</li>';261 107 } 262 108 263 109 function bp_adminbar_thisblog_menu() { 264 if ( current_user_can( 'edit_posts' ) ) {265 echo '<li id="bp-adminbar-thisblog-menu"><a href="' . admin_url() . '">';266 _e( 'Dashboard', 'buddypress' );267 echo '</a>';268 echo '<ul>';269 270 echo '<li class="alt"><a href="' . admin_url() . 'post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';271 echo '<li><a href="' . admin_url() . 'edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';272 echo '<li class="alt"><a href="' . admin_url() . 'edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';273 274 do_action( 'bp_adminbar_thisblog_items' );275 276 echo '</ul>';277 echo '</li>';278 }279 110 } 280 111 … … 287 118 */ 288 119 function bp_adminbar_random_menu() { 289 ?>290 291 <li class="align-right" id="bp-adminbar-visitrandom-menu">292 <a href="#"><?php _e( 'Visit', 'buddypress' ) ?></a>293 <ul class="random-list">294 <li><a href="<?php bp_members_directory_permalink(); ?>?random-member" rel="nofollow"><?php _e( 'Random Member', 'buddypress' ) ?></a></li>295 296 <?php if ( bp_is_active( 'groups' ) ) : ?>297 298 <li class="alt"><a href="<?php bp_groups_directory_permalink(); ?>?random-group" rel="nofollow"><?php _e( 'Random Group', 'buddypress' ) ?></a></li>299 300 <?php endif; ?>301 302 <?php if ( is_multisite() && bp_is_active( 'blogs' ) ) : ?>303 304 <li><a href="<?php bp_blogs_directory_permalink(); ?>?random-blog" rel="nofollow"><?php _e( 'Random Site', 'buddypress' ) ?></a></li>305 306 <?php endif; ?>307 308 <?php do_action( 'bp_adminbar_random_menu' ) ?>309 310 </ul>311 </li>312 313 <?php314 120 } 315 121 … … 320 126 */ 321 127 function bp_core_load_buddybar_css() { 322 323 if ( bp_use_wp_admin_bar() || ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) || ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) ) { 324 return; 325 } 326 327 $min = bp_core_get_minified_asset_suffix(); 328 329 if ( file_exists( get_stylesheet_directory() . '/_inc/css/adminbar.css' ) ) { // Backwards compatibility. 330 $stylesheet = get_stylesheet_directory_uri() . '/_inc/css/adminbar.css'; 331 } else { 332 $stylesheet = buddypress()->plugin_url . "bp-core/css/buddybar{$min}.css"; 333 } 334 335 wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_buddybar_rtl_css', $stylesheet ), array(), bp_get_version() ); 336 337 wp_style_add_data( 'bp-admin-bar', 'rtl', 'replace' ); 338 if ( $min ) { 339 wp_style_add_data( 'bp-admin-bar', 'suffix', $min ); 340 } 341 } 342 add_action( 'bp_init', 'bp_core_load_buddybar_css' ); 128 } 343 129 344 130 /** … … 350 136 */ 351 137 function bp_groups_adminbar_admin_menu() { 352 $bp = buddypress(); 353 354 if ( empty( $bp->groups->current_group ) ) { 355 return false; 356 } 357 358 // Only group admins and site admins can see this menu. 359 if ( !current_user_can( 'edit_users' ) && !bp_current_user_can( 'bp_moderate' ) && !bp_is_item_admin() ) { 360 return false; 361 } ?> 362 363 <li id="bp-adminbar-adminoptions-menu"> 364 <a href="<?php bp_groups_action_link( 'admin' ); ?>"><?php _e( 'Admin Options', 'buddypress' ); ?></a> 365 366 <ul> 367 <li><a href="<?php bp_groups_action_link( 'admin/edit-details' ); ?>"><?php _e( 'Edit Details', 'buddypress' ); ?></a></li> 368 369 <li><a href="<?php bp_groups_action_link( 'admin/group-settings' ); ?>"><?php _e( 'Group Settings', 'buddypress' ); ?></a></li> 370 371 <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) && $bp->avatar->show_avatars ) : ?> 372 373 <li><a href="<?php bp_groups_action_link( 'admin/group-avatar' ); ?>"><?php _e( 'Group Profile Photo', 'buddypress' ); ?></a></li> 374 375 <?php endif; ?> 376 377 <?php if ( bp_is_active( 'friends' ) ) : ?> 378 379 <li><a href="<?php bp_groups_action_link( 'send-invites' ); ?>"><?php _e( 'Manage Invitations', 'buddypress' ); ?></a></li> 380 381 <?php endif; ?> 382 383 <li><a href="<?php bp_groups_action_link( 'admin/manage-members' ); ?>"><?php _e( 'Manage Members', 'buddypress' ); ?></a></li> 384 385 <?php if ( $bp->groups->current_group->status == 'private' ) : ?> 386 387 <li><a href="<?php bp_groups_action_link( 'admin/membership-requests' ); ?>"><?php _e( 'Membership Requests', 'buddypress' ); ?></a></li> 388 389 <?php endif; ?> 390 391 <li><a class="confirm" href="<?php echo wp_nonce_url( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/delete-group/', 'groups_delete_group' ); ?>&delete-group-button=1&delete-group-understand=1"><?php _e( "Delete Group", 'buddypress' ) ?></a></li> 392 393 <?php do_action( 'bp_groups_adminbar_admin_menu' ) ?> 394 395 </ul> 396 </li> 397 398 <?php 399 } 400 add_action( 'bp_adminbar_menus', 'bp_groups_adminbar_admin_menu', 20 ); 138 } 401 139 402 140 /** … … 406 144 */ 407 145 function bp_adminbar_notifications_menu() { 408 409 // Bail if notifications is not active. 410 if ( ! bp_is_active( 'notifications' ) ) { 411 return false; 412 } 413 414 bp_notifications_buddybar_menu(); 415 } 416 add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 ); 146 } 417 147 418 148 /** … … 422 152 */ 423 153 function bp_adminbar_authors_menu() { 424 global $wpdb; 425 426 // Only for multisite. 427 if ( ! is_multisite() ) { 428 return false; 429 } 430 431 // Hide on root blog. 432 if ( bp_is_root_blog( $wpdb->blogid ) || ! bp_is_active( 'blogs' ) ) { 433 return false; 434 } 435 436 $blog_prefix = $wpdb->get_blog_prefix( $wpdb->blogid ); 437 $authors = $wpdb->get_results( "SELECT user_id, user_login, user_nicename, display_name, user_email, meta_value as caps FROM $wpdb->users u, $wpdb->usermeta um WHERE u.ID = um.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY um.user_id" ); 438 439 if ( !empty( $authors ) ) { 440 // This is a blog, render a menu with links to all authors. 441 echo '<li id="bp-adminbar-authors-menu"><a href="/">'; 442 _e('Blog Authors', 'buddypress'); 443 echo '</a>'; 444 445 echo '<ul class="author-list">'; 446 foreach( (array) $authors as $author ) { 447 $caps = maybe_unserialize( $author->caps ); 448 if ( isset( $caps['subscriber'] ) || isset( $caps['contributor'] ) ) { 449 continue; 450 } 451 452 echo '<li>'; 453 echo '<a href="' . bp_core_get_user_domain( $author->user_id, $author->user_nicename, $author->user_login ) . '">'; 454 echo bp_core_fetch_avatar( array( 455 'item_id' => $author->user_id, 456 'email' => $author->user_email, 457 'width' => 15, 458 'height' => 15, 459 'alt' => sprintf( 460 /* translators: %s: member name */ 461 __( 'Profile picture of %s', 'buddypress' ), 462 $author->display_name 463 ), 464 ) ); 465 echo ' ' . $author->display_name . '</a>'; 466 echo '<div class="admin-bar-clear"></div>'; 467 echo '</li>'; 468 } 469 echo '</ul>'; 470 echo '</li>'; 471 } 472 } 473 add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 ); 154 } 474 155 475 156 /** … … 482 163 */ 483 164 function bp_members_adminbar_admin_menu() { 484 485 // Only show if viewing a user. 486 if ( ! bp_displayed_user_id() ) { 487 return false; 488 } 489 490 // Don't show this menu to non site admins or if you're viewing your own profile. 491 if ( !current_user_can( 'edit_users' ) || bp_is_my_profile() ) { 492 return false; 493 } ?> 494 495 <li id="bp-adminbar-adminoptions-menu"> 496 497 <a href=""><?php _e( 'Admin Options', 'buddypress' ) ?></a> 498 499 <ul> 500 <?php if ( bp_is_active( 'xprofile' ) ) : ?> 501 502 <li> 503 <a href="<?php bp_members_component_link( 'profile', 'edit' ); ?>"> 504 <?php 505 /* translators: %s: member name */ 506 printf( __( "Edit %s's Profile", 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) ); 507 ?> 508 </a> 509 </li> 510 511 <?php endif ?> 512 513 <li> 514 <a href="<?php bp_members_component_link( 'profile', 'change-avatar' ); ?>"> 515 <?php 516 /* translators: %s: member name */ 517 printf( _x( "Edit %s's Profile Photo", 'deprecated string', 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) ); 518 ?> 519 </a> 520 </li> 521 522 <li><a href="<?php bp_members_component_link( 'settings', 'capabilities' ); ?>"><?php _e( 'User Capabilities', 'buddypress' ); ?></a></li> 523 524 <li> 525 <a href="<?php bp_members_component_link( 'settings', 'delete-account' ); ?>"> 526 <?php 527 /* translators: %s: member name */ 528 printf( _x( "Delete %s's Account", 'deprecated string', 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) ); 529 ?> 530 </a> 531 </li> 532 533 <?php do_action( 'bp_members_adminbar_admin_menu' ) ?> 534 535 </ul> 536 </li> 537 538 <?php 539 } 540 add_action( 'bp_adminbar_menus', 'bp_members_adminbar_admin_menu', 20 ); 165 } 541 166 542 167 /** … … 547 172 */ 548 173 function bp_notifications_buddybar_menu() { 549 550 if ( ! is_user_logged_in() ) { 551 return false; 552 } 553 554 echo '<li id="bp-adminbar-notifications-menu"><a href="' . esc_url( bp_loggedin_user_domain() ) . '">'; 555 _e( 'Notifications', 'buddypress' ); 556 557 $notification_count = bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ); 558 $notifications = bp_notifications_get_notifications_for_user( bp_loggedin_user_id() ); 559 560 if ( ! empty( $notification_count ) ) : ?> 561 <span><?php echo bp_core_number_format( $notification_count ); ?></span> 562 <?php 563 endif; 564 565 echo '</a>'; 566 echo '<ul>'; 567 568 if ( ! empty( $notifications ) ) { 569 $counter = 0; 570 for ( $i = 0, $count = count( $notifications ); $i < $count; ++$i ) { 571 $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?> 572 573 <li<?php echo $alt ?>><?php echo $notifications[$i] ?></li> 574 575 <?php $counter++; 576 } 577 } else { ?> 578 579 <li><a href="<?php echo esc_url( bp_loggedin_user_domain() ); ?>"><?php _e( 'No new notifications.', 'buddypress' ); ?></a></li> 580 581 <?php 582 } 583 584 echo '</ul>'; 585 echo '</li>'; 586 } 587 add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 ); 174 } 588 175 589 176 /** -
trunk/src/bp-core/deprecated/8.0.php
r12851 r12893 39 39 return bp_members_new_avatar_activity( $user_id ); 40 40 } 41 42 /** 43 * Should the old BuddyBar be forced in place of the WP admin bar? 44 * 45 * We deprecated the BuddyBar in v2.1.0, but have completely removed it in 46 * v8.0. 47 * 48 * @since 1.6.0 49 * @deprecated 8.0.0 50 * 51 * @return bool 52 */ 53 function bp_force_buddybar() { 54 _deprecated_function( __FUNCTION__, '8.0' ); 55 56 return false; 57 } -
trunk/src/bp-groups/bp-groups-notifications.php
r12719 r12893 383 383 * @param int $total_items The total number of messaging-related notifications 384 384 * waiting for the user. 385 * @param string $format 'string' for BuddyBar-compatible notifications; 'array'385 * @param string $format 'string' for notification HTML link or 'array' for separate link and text. 386 386 * for WP Toolbar. Default: 'string'. 387 387 * @return string -
trunk/src/bp-groups/classes/class-bp-groups-component.php
r12757 r12893 595 595 'name' => __( 'Memberships', 'buddypress' ), 596 596 'slug' => $this->current_group->slug, 597 'position' => -1, // Do not show in BuddyBar.597 'position' => -1, // Do not show into the navigation. 598 598 'screen_function' => 'groups_screen_group_home', 599 599 'default_subnav_slug' => $this->default_extension, -
trunk/src/bp-messages/bp-messages-notifications.php
r12592 r12893 21 21 * @param int $total_items The total number of messaging-related notifications 22 22 * waiting for the user. 23 * @param string $format Return value format. 'string' for BuddyBar-compatible 24 * notifications; 'array' for WP Toolbar. Default: 'string'. 23 * @param string $format 'string' for notification HTML link or 'array' for separate link and text. 25 24 * @return string|array Formatted notifications. 26 25 */ -
trunk/src/bp-xprofile/bp-xprofile-notifications.php
r10434 r12893 20 20 * @param int $total_items The total number of messaging-related notifications 21 21 * waiting for the user. 22 * @param string $format 'string' for BuddyBar-compatible notifications; 'array' 23 * for WP Toolbar. Default: 'string'. 22 * @param string $format 'string' for notification HTML link or 'array' for separate link and text. 24 23 * @return string 25 24 */
Note: See TracChangeset
for help on using the changeset viewer.