• Hey gang, just wondering how you specify that a custom link in the toolbar only appears on the frontend? I’ve got the below code installed, but shows both in the backend and frontend.

    //Add Pages to admin bar
    
    function custom_toolbar_link($wp_admin_bar) {
    	$args = array(
    		'id' => 'pages-toolbar',
    		'title' => 'Pages', 
    		'href' => '/wp-admin/edit.php?post_type=page', 
    		'meta' => array(
    			'class' => 'pages-toolbar', 
    			'title' => 'Pages'
    			)
    	);
    	$wp_admin_bar->add_node($args);
    }
    add_action('admin_bar_menu', 'custom_toolbar_link', 999);

    Thanks in advance

    • This topic was modified 3 years, 9 months ago by charliejustus. Reason: Spelling error
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘only add toolbar links to frontend toolbar’ is closed to new replies.