Last active
May 11, 2018 21:26
-
-
Save Idealien/2485679dbb29334e7927ab8e4c68d234 to your computer and use it in GitHub Desktop.
Custom Admin Bar Links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('admin_bar_menu', 'custom_toolbar_links', 10, 1); | |
function custom_toolbar_links($wp_admin_bar) { | |
$user = wp_get_current_user(); | |
if( in_array( "staff", $user->roles ) ): | |
$wp_admin_bar->add_node(array( | |
'id' => 'hotlinks', | |
'title' => 'Hotlinks', | |
'href' => '/hotlinks/', | |
'meta' => array( | |
'class' => 'hotlinks', | |
'title' => 'Hotlinks' | |
) | |
) | |
); | |
$wp_admin_bar->add_node(array( | |
'id' => 'approvals', | |
'title' => 'Approvals', | |
'href' => '/approvals/', | |
'parent' => 'hotlinks', | |
'meta' => array( | |
'class' => 'hotlinks', | |
'title' => 'Approvals' | |
) | |
) | |
); | |
endif; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment