Skip to:
Content
Pages
Categories
Search
Top
Bottom

BP 1.1 – How to alter the adminbar!?


  • 21cdb
    Participant

    @21cdb

    I’m using WPMU 2.8.4a with the latest version of trunk (r1703) and i want to alter the appeareance of the wp-admin-bar.

    On line 11 of bp-core/bp-core-cssjs.php i found the following code:

    `

    function bp_core_add_admin_bar_css() {

    global $current_blog;

    if ( defined( ‘BP_DISABLE_ADMIN_BAR’) )

    return false;

    if ( BP_ROOT_BLOG == $current_blog->blog_id && !is_admin() )

    return false;

    /* Fetch the admin bar css from the active theme location */

    if ( file_exists( WP_CONTENT_DIR . ‘/themes/’ . get_blog_option( BP_ROOT_BLOG, ‘stylesheet’ ) . ‘/_inc/css/adminbar.css’ ) )

    $admin_bar_css = WP_CONTENT_URL . ‘/themes/’ . get_blog_option( BP_ROOT_BLOG, ‘stylesheet’ ) . ‘/_inc/css/adminbar.css’;

    else if ( file_exists( WP_CONTENT_DIR . ‘/’ . get_blog_option( BP_ROOT_BLOG, ‘template’ ) . ‘/_inc/css/adminbar.css’ ) )

    $admin_bar_css = WP_CONTENT_URL . ‘/themes/’ . get_blog_option( BP_ROOT_BLOG, ‘template’ ) . ‘/_inc/css/adminbar.css’;

    else

    $admin_bar_css = BP_PLUGIN_URL . ‘/bp-core/deprecated/css/admin-bar.css’;

    wp_enqueue_style( ‘bp-admin-bar’, apply_filters( ‘bp_core_admin_bar_css’, $admin_bar_css ) );

    }

    add_action( ‘admin_menu’, ‘bp_core_add_admin_bar_css’ );

    add_action( ‘template_redirect’, ‘bp_core_add_admin_bar_css’ );

    I put my custom adminbar.css in bp-default/_inc/css. These styles are working for all my blog templates exept for my main Buddypress site and all the admin backends/dashboards. On this sites another file is winning the css fight versus my adminbar.css (the file is located in bp-core/depreceated/css/admin-bar.css?ver=2.8.4)

    What do i have to do to apply my custom styles also on the main bp-site and on all admin areas!? Or what do i have to do to get rid of the admin-bar.css located in bp-core/depreceated/css/?

    In the past i used the following function via bp-custom.php to remove the original-admin-bar.css in the admin backend/dashboard but it stopped to work with the latest trunk:

    function remove_adminbar_css(){

    remove_action(‘admin_menu’, ‘bp_core_add_admin_css’);

    }

    add_action(‘init’,’remove_adminbar_css’);

    Any ideas? How is it supposed to work on BP 1.1?

  • The topic ‘BP 1.1 – How to alter the adminbar!?’ is closed to new replies.
Skip to toolbar