• Resolved connor234

    (@connor234)


    Hi there,

    How can I change or add links to this area of the Admin menubar for WooCommerce Product Vendor?

    Any help would be great!

    Cheers

Viewing 1 replies (of 1 total)
  • Plugin Contributor James Koster

    (@jameskoster)

    Hey,

    The short answer is to interact with the admin_bar_menu action. See here.

    To add a whole new menu you could do the following;

    
     add_action( 'admin_bar_menu', 'webmaster_admin_bar_menu', 50 );
     function webmaster_admin_bar_menu() {
    
    	global $wp_admin_bar;
    
    	$menus[] = array(
    		'id'    => 'jk_new_menu',
    		'title' => 'New Menu',
    		'href'  => '',
    		'meta'  => array(
    			'target' => 'blank',
    		)
    	);
    
    	$menus[] = array(
    		'id'     => 'new_link',
    		'parent' => 'jk_new_menu',
    		'title'  => 'New Link',
    		'href'   => 'https://www.ads-software.com/',
    		'meta'   => array(
    			'target' => 'blank',
    		)
    	);
    
    	foreach ( apply_filters( 'jk_new_menu', $menus ) as $menu )
    
    	$wp_admin_bar->add_menu( $menu );
     }
    

    To add a new link to the site menu specifically you could use;

     
    add_action( 'admin_bar_menu', 'webmaster_admin_bar_menu', 50 );
     function webmaster_admin_bar_menu() {
    
    	global $wp_admin_bar;
    
    	$menus[] = array(
    		'id'     => 'new_link',
    		'parent' => 'site-name',
    		'title'  => 'New Link',
    		'href'   => 'https://www.ads-software.com/',
    		'meta'   => array(
    			'target' => 'blank',
    		)
    	);
    
    	foreach ( apply_filters( 'jk_new_menu', $menus ) as $menu )
    
    	$wp_admin_bar->add_menu( $menu );
     }
    

    From there you should be able customise to suit your needs ??

    James
    Designer @ Automattic

Viewing 1 replies (of 1 total)
  • The topic ‘Woo Vendor’ is closed to new replies.