diff --git src/bp-activity/bp-activity-notifications.php src/bp-activity/bp-activity-notifications.php index 0b9600ff5..b36812025 100644 --- src/bp-activity/bp-activity-notifications.php +++ src/bp-activity/bp-activity-notifications.php @@ -19,7 +19,7 @@ defined( 'ABSPATH' ) || exit; * @param int $item_id The activity ID. * @param int $secondary_item_id In the case of at-mentions, this is the mentioner's ID. * @param int $total_items The total number of notifications to format. - * @param string $format 'string' to get a BuddyBar-compatible notification, 'array' otherwise. + * @param string $format 'string' for notification HTML link or 'array' for separate link and text. * @param int $id Optional. The notification ID. * @return string $return Formatted @mention notification. */ diff --git src/bp-core/bp-core-adminbar.php src/bp-core/bp-core-adminbar.php index 022bddd06..9858dfbc2 100644 --- src/bp-core/bp-core-adminbar.php +++ src/bp-core/bp-core-adminbar.php @@ -44,39 +44,20 @@ function bp_admin_bar_my_account_root() { add_action( 'admin_bar_menu', 'bp_admin_bar_my_account_root', 100 ); /** - * Handle the Toolbar/BuddyBar business. + * Toggle the display of the toolbar based on certain conditions. * * @since 1.2.0 */ function bp_core_load_admin_bar() { - // Show the Toolbar for logged out users. if ( ! is_user_logged_in() && (int) bp_get_option( 'hide-loggedout-adminbar' ) != 1 ) { show_admin_bar( true ); } - // Hide the WordPress Toolbar and show the BuddyBar. + // Hide the WordPress Toolbar. if ( ! bp_use_wp_admin_bar() ) { - _doing_it_wrong( __FUNCTION__, __( 'The BuddyBar is no longer supported. Please migrate to the WordPress toolbar as soon as possible.', 'buddypress' ), '2.1.0' ); - - // Load deprecated code if not available. - if ( ! function_exists( 'bp_core_admin_bar' ) ) { - require buddypress()->plugin_dir . 'bp-core/deprecated/2.1.php'; - } - // Keep the WP Toolbar from loading. show_admin_bar( false ); - - // Actions used to build the BP Toolbar. - add_action( 'bp_adminbar_logo', 'bp_adminbar_logo' ); - add_action( 'bp_adminbar_menus', 'bp_adminbar_login_menu', 2 ); - add_action( 'bp_adminbar_menus', 'bp_adminbar_account_menu', 4 ); - add_action( 'bp_adminbar_menus', 'bp_adminbar_thisblog_menu', 6 ); - add_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu', 100 ); - - // Actions used to append BP Toolbar to footer. - add_action( 'wp_footer', 'bp_core_admin_bar', 8 ); - add_action( 'admin_footer', 'bp_core_admin_bar' ); } } add_action( 'init', 'bp_core_load_admin_bar', 9 ); diff --git src/bp-core/bp-core-buddybar.php src/bp-core/bp-core-buddybar.php index c78061049..afbb2f287 100644 --- src/bp-core/bp-core-buddybar.php +++ src/bp-core/bp-core-buddybar.php @@ -5,8 +5,6 @@ * @package BuddyPress * @subpackage Core * @since 1.5.0 - * - * @todo Deprecate BuddyBar functions. */ // Exit if accessed directly. diff --git src/bp-core/bp-core-functions.php src/bp-core/bp-core-functions.php index ccc469a41..7cd50e4f2 100644 --- src/bp-core/bp-core-functions.php +++ src/bp-core/bp-core-functions.php @@ -420,16 +420,12 @@ function bp_is_username_compatibility_mode() { */ function bp_use_wp_admin_bar() { - // Default to true (to avoid loading deprecated BuddyBar code). + // Default to true. $use_admin_bar = true; // Has the WP Toolbar constant been explicitly opted into? if ( defined( 'BP_USE_WP_ADMIN_BAR' ) ) { $use_admin_bar = (bool) BP_USE_WP_ADMIN_BAR; - - // ...or is the old BuddyBar being forced back into use? - } elseif ( bp_force_buddybar( false ) ) { - $use_admin_bar = false; } /** diff --git src/bp-core/bp-core-options.php src/bp-core/bp-core-options.php index 7a88ca551..e539a06ff 100644 --- src/bp-core/bp-core-options.php +++ src/bp-core/bp-core-options.php @@ -90,11 +90,6 @@ function bp_get_default_options() { // HeartBeat is on to refresh activities. '_bp_enable_heartbeat_refresh' => true, - /* BuddyBar **********************************************************/ - - // Force the BuddyBar. - '_bp_force_buddybar' => false, - /* Legacy *********************************************/ // Do not register the bp-default themes directory. @@ -667,27 +662,6 @@ function bp_restrict_group_creation( $default = true ) { return (bool) apply_filters( 'bp_restrict_group_creation', (bool) bp_get_option( 'bp_restrict_group_creation', $default ) ); } -/** - * Should the old BuddyBar be forced in place of the WP admin bar? - * - * @since 1.6.0 - * - * @param bool $default Optional. Fallback value if not found in the database. - * Default: true. - * @return bool True if the BuddyBar should be forced on, otherwise false. - */ -function bp_force_buddybar( $default = true ) { - - /** - * Filters whether or not BuddyBar should be forced in place of WP Admin Bar. - * - * @since 1.6.0 - * - * @param bool $value Whether or not BuddyBar should be forced in place of WP Admin Bar. - */ - return (bool) apply_filters( 'bp_force_buddybar', (bool) bp_get_option( '_bp_force_buddybar', $default ) ); -} - /** * Check whether Akismet is enabled. * diff --git src/bp-core/classes/class-bp-admin.php src/bp-core/classes/class-bp-admin.php index e51b60ecb..52a739ba0 100644 --- src/bp-core/classes/class-bp-admin.php +++ src/bp-core/classes/class-bp-admin.php @@ -375,17 +375,6 @@ class BP_Admin { add_settings_field( 'hide-loggedout-adminbar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_admin_bar', 'buddypress', 'bp_main' ); register_setting( 'buddypress', 'hide-loggedout-adminbar', 'intval' ); - // Only show 'switch to Toolbar' option if the user chose to retain the BuddyBar during the 1.6 upgrade. - if ( (bool) bp_get_option( '_bp_force_buddybar', false ) ) { - // Load deprecated code if not available. - if ( ! function_exists( 'bp_admin_setting_callback_force_buddybar' ) ) { - require buddypress()->plugin_dir . 'bp-core/deprecated/2.1.php'; - } - - add_settings_field( '_bp_force_buddybar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_force_buddybar', 'buddypress', 'bp_main' ); - register_setting( 'buddypress', '_bp_force_buddybar', 'bp_admin_sanitize_callback_force_buddybar' ); - } - // Allow account deletion. add_settings_field( 'bp-disable-account-deletion', __( 'Account Deletion', 'buddypress' ), 'bp_admin_setting_callback_account_deletion', 'buddypress', 'bp_main' ); register_setting( 'buddypress', 'bp-disable-account-deletion', 'intval' ); diff --git src/bp-core/css/buddybar-rtl.css src/bp-core/css/buddybar-rtl.css deleted file mode 100644 index 01cbc9867..000000000 --- src/bp-core/css/buddybar-rtl.css +++ /dev/null @@ -1,235 +0,0 @@ -body:not(.wp-admin) { - padding-top: 25px !important; -} - -#wp-admin-bar { - position: fixed; - top: 0; - right: 0; - height: 25px; - font-size: 11px; - width: 100%; - z-index: 9999; -} - -#wp-admin-bar .padder { - position: relative; - padding: 0; - width: 100%; - margin: 0 auto; - background: url(../images/60pc_black.png); - height: 25px; -} - -body#bp-default #wp-admin-bar .padder { - max-width: 1250px; -} - -#wp-admin-bar * { - z-index: 999; -} - -#wp-admin-bar div#admin-bar-logo { - position: absolute; - top: 5px; - right: 10px; -} - -#wp-admin-bar a img { - border: none; -} - -#wp-admin-bar li { - list-style: none; - margin: 0; - padding: 0; - line-height: 1; - text-align: right; -} - -#wp-admin-bar li a { - padding: 7px 15px; - color: #eee; - text-decoration: none; - font-size: 11px; -} - -#wp-admin-bar li.alt { - border: none; -} - -#wp-admin-bar li.no-arrow a { - padding-left: 15px; -} - -#wp-admin-bar ul li ul li a span { - display: none; -} - -#wp-admin-bar li:hover, -#wp-admin-bar li.hover { - position: static; -} - -#admin-bar-logo { - float: right; - font-weight: 700; - font-size: 11px; - padding: 5px 8px; - margin: 0; - text-decoration: none; - color: #fff; -} - -body#bp-default #admin-bar-logo { - padding: 2px 8px; -} - -/* all lists */ -#wp-admin-bar ul { - margin: 0; - list-style: none; - line-height: 1; - cursor: pointer; - height: auto; - padding: 0; -} - -/* all list items */ -#wp-admin-bar ul li { - padding: 0; - float: right; - position: relative; - background: url(../images/admin-menu-arrow.gif) 12% 53% no-repeat; - padding-left: 11px; -} - -#wp-admin-bar ul li.no-arrow { - background: none; - padding-left: 0; -} - -#wp-admin-bar ul li ul li { - background-image: none; -} - -#wp-admin-bar ul li.align-right { - position: absolute; - left: 0; -} - -#wp-admin-bar ul li a { - display: block; -} - -#wp-admin-bar ul.main-nav li:hover, -#wp-admin-bar ul.main-nav li.sfhover, -#wp-admin-bar ul.main-nav li ul li.sfhover { - background-color: #333; -} - -/* second-level lists */ -#wp-admin-bar ul li ul { - position: absolute; - width: 185px; - right: -999em; - margin-right: 0; - background: #333; - border: 1px solid #222; - -moz-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); - -webkit-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - -moz-border-radius-topright: 0; - -webkit-border-top-right-radius: 0; - -moz-border-radius-topleft: 0; - -webkit-border-top-left-radius: 0; -} - -#wp-admin-bar ul li > ul { - border-top: none; -} - -#wp-admin-bar ul li ul a { - color: #eee; -} - -#wp-admin-bar ul li ul li { - float: right; - width: 174px; - margin: 0; -} - -#wp-admin-bar ul li ul li:hover a { - color: #fff; -} - -#wp-admin-bar ul li div.admin-bar-clear { - clear: both; -} - -#wp-admin-bar ul.main-nav li ul li:hover, -#wp-admin-bar ul.main-nav li ul li.sfhover, -#wp-admin-bar ul.main-nav li ul li.sfhover { - background-color: #222; -} - -/* third-and-above-level lists */ -#wp-admin-bar ul li ul ul { - margin: -25px 184px 0 0; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; -} - -#wp-admin-bar ul li ul li:hover ul li a { - color: #eee; -} - -#wp-admin-bar ul li ul li ul li:hover a { - color: #fff; -} - -#wp-admin-bar ul li:hover ul, -#wp-admin-bar ul li ul li:hover ul, -#wp-admin-bar ul li.sfhover ul, -#wp-admin-bar ul li ul li.sfhover ul { - right: auto; -} - -#wp-admin-bar ul li.align-right:hover ul { - left: 0; -} - -#wp-admin-bar ul li:hover ul ul, -#wp-admin-bar li.sfhover ul li ul { - right: -999em; -} - -/* Menu item css */ -#wp-admin-bar img.avatar { - float: right; - margin-left: 8px; -} - -#wp-admin-bar span.activity { - display: block; - margin-right: 34px; - padding: 0; -} - -#wp-admin-bar ul.author-list li a { - height: 17px; -} - -#wp-admin-bar ul li#bp-adminbar-notifications-menu a span { - padding: 0 6px; - margin-right: 2px; - background: #fff; - color: #000; - border-radius: 3px; -} - -#wp-admin-bar-user-info img.avatar { - height: 64px; - width: 64px; -} diff --git src/bp-core/css/buddybar.css src/bp-core/css/buddybar.css deleted file mode 100644 index cc1e73c89..000000000 --- src/bp-core/css/buddybar.css +++ /dev/null @@ -1,235 +0,0 @@ -body:not(.wp-admin) { - padding-top: 25px !important; -} - -#wp-admin-bar { - position: fixed; - top: 0; - left: 0; - height: 25px; - font-size: 11px; - width: 100%; - z-index: 9999; -} - -#wp-admin-bar .padder { - position: relative; - padding: 0; - width: 100%; - margin: 0 auto; - background: url(../images/60pc_black.png); - height: 25px; -} - -body#bp-default #wp-admin-bar .padder { - max-width: 1250px; -} - -#wp-admin-bar * { - z-index: 999; -} - -#wp-admin-bar div#admin-bar-logo { - position: absolute; - top: 5px; - left: 10px; -} - -#wp-admin-bar a img { - border: none; -} - -#wp-admin-bar li { - list-style: none; - margin: 0; - padding: 0; - line-height: 1; - text-align: left; -} - -#wp-admin-bar li a { - padding: 7px 15px; - color: #eee; - text-decoration: none; - font-size: 11px; -} - -#wp-admin-bar li.alt { - border: none; -} - -#wp-admin-bar li.no-arrow a { - padding-right: 15px; -} - -#wp-admin-bar ul li ul li a span { - display: none; -} - -#wp-admin-bar li:hover, -#wp-admin-bar li.hover { - position: static; -} - -#admin-bar-logo { - float: left; - font-weight: 700; - font-size: 11px; - padding: 5px 8px; - margin: 0; - text-decoration: none; - color: #fff; -} - -body#bp-default #admin-bar-logo { - padding: 2px 8px; -} - -/* all lists */ -#wp-admin-bar ul { - margin: 0; - list-style: none; - line-height: 1; - cursor: pointer; - height: auto; - padding: 0; -} - -/* all list items */ -#wp-admin-bar ul li { - padding: 0; - float: left; - position: relative; - background: url(../images/admin-menu-arrow.gif) 88% 53% no-repeat; - padding-right: 11px; -} - -#wp-admin-bar ul li.no-arrow { - background: none; - padding-right: 0; -} - -#wp-admin-bar ul li ul li { - background-image: none; -} - -#wp-admin-bar ul li.align-right { - position: absolute; - right: 0; -} - -#wp-admin-bar ul li a { - display: block; -} - -#wp-admin-bar ul.main-nav li:hover, -#wp-admin-bar ul.main-nav li.sfhover, -#wp-admin-bar ul.main-nav li ul li.sfhover { - background-color: #333; -} - -/* second-level lists */ -#wp-admin-bar ul li ul { - position: absolute; - width: 185px; - left: -999em; - margin-left: 0; - background: #333; - border: 1px solid #222; - -moz-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); - -webkit-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - -moz-border-radius-topleft: 0; - -webkit-border-top-left-radius: 0; - -moz-border-radius-topright: 0; - -webkit-border-top-right-radius: 0; -} - -#wp-admin-bar ul li > ul { - border-top: none; -} - -#wp-admin-bar ul li ul a { - color: #eee; -} - -#wp-admin-bar ul li ul li { - float: left; - width: 174px; - margin: 0; -} - -#wp-admin-bar ul li ul li:hover a { - color: #fff; -} - -#wp-admin-bar ul li div.admin-bar-clear { - clear: both; -} - -#wp-admin-bar ul.main-nav li ul li:hover, -#wp-admin-bar ul.main-nav li ul li.sfhover, -#wp-admin-bar ul.main-nav li ul li.sfhover { - background-color: #222; -} - -/* third-and-above-level lists */ -#wp-admin-bar ul li ul ul { - margin: -25px 0 0 184px; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; -} - -#wp-admin-bar ul li ul li:hover ul li a { - color: #eee; -} - -#wp-admin-bar ul li ul li ul li:hover a { - color: #fff; -} - -#wp-admin-bar ul li:hover ul, -#wp-admin-bar ul li ul li:hover ul, -#wp-admin-bar ul li.sfhover ul, -#wp-admin-bar ul li ul li.sfhover ul { - left: auto; -} - -#wp-admin-bar ul li.align-right:hover ul { - right: 0; -} - -#wp-admin-bar ul li:hover ul ul, -#wp-admin-bar li.sfhover ul li ul { - left: -999em; -} - -/* Menu item css */ -#wp-admin-bar img.avatar { - float: left; - margin-right: 8px; -} - -#wp-admin-bar span.activity { - display: block; - margin-left: 34px; - padding: 0; -} - -#wp-admin-bar ul.author-list li a { - height: 17px; -} - -#wp-admin-bar ul li#bp-adminbar-notifications-menu a span { - padding: 0 6px; - margin-left: 2px; - background: #fff; - color: #000; - border-radius: 3px; -} - -#wp-admin-bar-user-info img.avatar { - height: 64px; - width: 64px; -} diff --git src/bp-core/deprecated/2.1.php src/bp-core/deprecated/2.1.php index 2e66cea2c..fafb13a46 100644 --- src/bp-core/deprecated/2.1.php +++ src/bp-core/deprecated/2.1.php @@ -39,61 +39,6 @@ function bp_core_register_deprecated_styles() { * @return false|null Returns false on failure. Otherwise echoes the menu item. */ function bp_adminbar_blogs_menu() { - - if ( ! is_user_logged_in() || ! bp_is_active( 'blogs' ) ) { - return false; - } - - if ( ! is_multisite() ) { - return false; - } - - $blogs = wp_cache_get( 'bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', 'bp' ); - if ( empty( $blogs ) ) { - $blogs = bp_blogs_get_blogs_for_user( bp_loggedin_user_id(), true ); - wp_cache_set( 'bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', $blogs, 'bp' ); - } - - $counter = 0; - if ( is_array( $blogs['blogs'] ) && (int) $blogs['count'] ) { - - echo '