Add Admin Bar Items

<?php

/* Rating Menu Item */
function psra_admin_bar_render(){
global $wp_admin_bar;
$wp_admin_bar->add_menu( array(
'parent' => 'ps_admin_menu', // use 'false' for a root menu, or pass the ID of the parent menu
'id' => 'psra_ratings', // link ID, defaults to a sanitized title value
'title' => __('Ratings'), // link title
'href' => admin_url('edit.php?post_type=ps_rating'), // name of file
'meta' => false // array of any of the following options: array( 'html' => '', 'class' => '', 'onclick' => '', target => '', title => '' );
));
$wp_admin_bar->add_menu( array(
'parent' => 'ps_admin_menu', // use 'false' for a root menu, or pass the ID of the parent menu
'id' => 'psra_new_rating', // link ID, defaults to a sanitized title value
'title' => __('New Rating'), // link title
'href' => 'http://provensystems.com/blog/ps-new-rating/', // name of file
'meta' => false // array of any of the following options: array( 'html' => '', 'class' => '', 'onclick' => '', target => '', title => '' );
));
}

add_action('wp_before_admin_bar_render','psra_admin_bar_render');

?>

0 Comments

You must be logged in to post a comment.