/**
* add_admin_menu - conditional Administration menu for logged in users
*
* @author Gary Jones
* @version 2010-02-16
* @since 2010-02-16
**/
function add_admin_menu() {
/* Grab some info about the visitor */
get_currentuserinfo();
/* Make sure we can access the role levels built in to WP */
global $user_level;
if ( $user_level > 0 ) {
/* user is logged in */
?>
<li class="tab tab-admin">
<a href="/wp-admin" title="Admin Dashboard">Admin</a>
<ul class="submenu submenu-1">
<li class="item item-1">
<a href="/wp-admin/post.php?action=edit&post=ID;?>" title="Edit Post">Edit Post</a>
</li>
<li class="item item-2">
<a href="/wp-admin/page.php?action=edit&post=ID;?>" title="Edit Page">Edit Page</a>
</li>
<li class="item item-3">
<a href="http://diythemes.com/forums/" title="Thesis Forum">Get Support</a>
</li>
<li class="item item-4">
<a href="http://garyjones.co.uk/helped">Say Thanks!</a>
</li>
</ul>
</li>
<?php
} else {
/* user is not logged in */
/* in this case, show nothing */
}
}
add_action('thesis_hook_last_nav_item', 'add_admin_menu');
I’m fascinated by your code. Very cool. Do you take contract/freelance jobs? I have so many little development projects I am looking to do and could really use the help from someone like you.
Sure – please get in touch via the contact page of http://gamajo.com and we can see if there’s something I can do for you.