WordPress.org

Ready to get started?Download WordPress

Forums

BuddyPress
[resolved] Admin Bar Function - Bp Root not Network Home- PHP (2 posts)

  1. valuser
    Member
    Posted 2 years ago #

    For a BuddyPress Site I have a function for putting "Groups", or other menu items in the wp-admin bar.

    This is it

    function bcustom_adminbar_menu() {
    	global $wp_admin_bar;
    		if ( !is_user_logged_in() ) { return; }
    	$wp_admin_bar->add_menu( array(
    		'id' => 'bcustom_menu',
    		'title' => __( 'Groups' ),
    		'href' => network_home_url('/groups/')
    		 )
    	);
    }
    add_action( 'admin_bar_menu', 'bcustom_adminbar_menu', 15 );

    However if the bp root blog is not the network home then the function is incorrect.

    Could somebody please help me to change the line

    'href' => network_home_url('/groups/')

    so that it goes to or is equivalent to

    <a href="<?php echo get_blog_option( BP_ROOT_BLOG, 'siteurl') ?>/groups/">Groups</a>

    Thanks.

    http://wordpress.org/extend/plugins/buddypress/

  2. valuser
    Member
    Posted 2 years ago #

    found it

    $link = get_blog_option( BP_ROOT_BLOG, 'siteurl') . '/tag/'

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic