plugin_url . 'bp-core/deprecated/js/'; $scripts = apply_filters( 'bp_core_register_deprecated_scripts', array( // Messages 'bp-jquery-autocomplete' => array( 'file' => "{$url}autocomplete/jquery.autocomplete{$min}.js", 'dependencies' => array( 'jquery' ), ), 'bp-jquery-autocomplete-fb' => array( 'file' => "{$url}autocomplete/jquery.autocompletefb{$min}.js", 'dependencies' => array( 'jquery' ), ), 'bp-jquery-bgiframe' => array( 'file' => "{$url}autocomplete/jquery.bgiframe{$min}.js", 'dependencies' => array( 'jquery' ), ), 'bp-jquery-dimensions' => array( 'file' => "{$url}autocomplete/jquery.dimensions{$min}.js", 'dependencies' => array( 'jquery' ), ), ) ); foreach ( $scripts as $id => $script ) { wp_register_script( $id, $script['file'], $script['dependencies'], bp_get_version(), true ); } } add_action( 'bp_enqueue_scripts', 'bp_core_register_deprecated_scripts', 1 ); /** * Register (not enqueue) styles that used to be used by BuddyPress. * * @since 2.1.0 */ function bp_core_register_deprecated_styles() { $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; $url = buddypress()->plugin_url . 'bp-core/deprecated/css/'; $styles = apply_filters( 'bp_core_register_deprecated_styles', array( // Messages 'bp-messages-autocomplete' => array( 'file' => "{$url}autocomplete/jquery.autocompletefb{$min}.css", 'dependencies' => array(), ) ) ); foreach ( $styles as $id => $style ) { wp_register_style( $id, $style['file'], $style['dependencies'], bp_get_version() ); wp_style_add_data( $id, 'rtl', true ); if ( $min ) { wp_style_add_data( $id, 'suffix', $min ); } } } add_action( 'bp_enqueue_scripts', 'bp_core_register_deprecated_styles', 1 ); /** BuddyBar *****************************************************************/ /** * Add a Sites menu to the BuddyBar. * * @since 1.0.0 * @deprecated 2.1.0 * * @return bool|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 '
  • '; _e( 'My Sites', 'buddypress' ); echo ''; echo ''; echo '
  • '; } } /** * If user has upgraded to 1.6 and chose to retain their BuddyBar, offer then a switch to change over * to the WP Toolbar. * * @since 1.6.0 * @deprecated 2.1.0 */ function bp_admin_setting_callback_force_buddybar() { ?> /> doing_admin_bar = true; echo '
    '; // **** Do bp-adminbar-logo Actions ******** do_action( 'bp_adminbar_logo' ); echo ''; echo "
    \n\n"; $bp->doing_admin_bar = false; } /** * Output the BuddyBar logo. * * @deprecated 2.1.0 */ function bp_adminbar_logo() { echo ''; } /** * Output the "Log In" and "Sign Up" names to the BuddyBar. * * Visible only to visitors who are not logged in. * * @deprecated 2.1.0 * * @return bool|null Returns false if the current user is logged in. */ function bp_adminbar_login_menu() { if ( is_user_logged_in() ) { return false; } echo '
  • ' . __( 'Log In', 'buddypress' ) . '
  • '; // Show "Sign Up" link if user registrations are allowed if ( bp_get_signup_allowed() ) { echo '
  • ' . __( 'Sign Up', 'buddypress' ) . '
  • '; } } /** * Output the My Account BuddyBar menu. * * @deprecated 2.1.0 * * @return bool|null Returns false on failure. */ function bp_adminbar_account_menu() { $bp = buddypress(); if ( empty( $bp->bp_nav ) || ! is_user_logged_in() ) { return false; } echo '
  • '; echo __( 'My Account', 'buddypress' ) . ''; echo ''; echo '
  • '; } function bp_adminbar_thisblog_menu() { if ( current_user_can( 'edit_posts' ) ) { echo '
  • '; _e( 'Dashboard', 'buddypress' ); echo ''; echo ''; echo '
  • '; } } /** * Output the Random BuddyBar menu. * * Not visible for logged-in users. * * @deprecated 2.1.0 */ function bp_adminbar_random_menu() { ?>
  • plugin_url . "bp-core/css/buddybar{$min}.css"; } wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_buddybar_rtl_css', $stylesheet ), array(), bp_get_version() ); wp_style_add_data( 'bp-admin-bar', 'rtl', true ); if ( $min ) { wp_style_add_data( 'bp-admin-bar', 'suffix', $min ); } } add_action( 'bp_init', 'bp_core_load_buddybar_css' ); /** * Add menu items to the BuddyBar. * * @since 1.0.0 * * @deprecated 2.1.0 */ function bp_groups_adminbar_admin_menu() { $bp = buddypress(); if ( empty( $bp->groups->current_group ) ) { return false; } // Only group admins and site admins can see this menu if ( !current_user_can( 'edit_users' ) && !bp_current_user_can( 'bp_moderate' ) && !bp_is_item_admin() ) { return false; } ?>
  • blogid ) || ! bp_is_active( 'blogs' ) ) { return false; } $blog_prefix = $wpdb->get_blog_prefix( $wpdb->blogid ); $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" ); if ( !empty( $authors ) ) { // This is a blog, render a menu with links to all authors echo '
  • '; _e('Blog Authors', 'buddypress'); echo ''; echo ''; echo '
  • '; } } add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 ); /** * Add a member admin menu to the BuddyBar. * * Adds an Toolbar menu to any profile page providing site moderator actions * that allow capable users to clean up a users account. * * @deprecated 2.1.0 */ function bp_members_adminbar_admin_menu() { // Only show if viewing a user if ( ! bp_displayed_user_id() ) { return false; } // Don't show this menu to non site admins or if you're viewing your own profile if ( !current_user_can( 'edit_users' ) || bp_is_my_profile() ) { return false; } ?>
  • '; _e( 'Notifications', 'buddypress' ); $notification_count = bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ); $notifications = bp_notifications_get_notifications_for_user( bp_loggedin_user_id() ); if ( ! empty( $notification_count ) ) : ?> '; echo '