Advertisement
SergeyBiryukov

[WP Cases] Add New Content Menu Item

Jun 21st, 2012
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. function cases_add_new_content_menu_item( $wp_admin_bar ) {
  2.     if ( ! post_type_exists( 'cases' ) || ! current_user_can( 'edit_posts' ) )
  3.         return;
  4.  
  5.     $wp_admin_bar->add_menu( array(
  6.         'parent'    => 'new-content',
  7.         'id'        => 'new-case',
  8.         'title'     => 'Дело',
  9.         'href'      => admin_url( 'post-new.php?post_type=cases' )
  10.     ) );
  11. }
  12. add_action( 'admin_bar_menu', 'cases_add_new_content_menu_item' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement