{"id":3048,"date":"2014-06-11T21:23:38","date_gmt":"2014-06-11T21:23:38","guid":{"rendered":"http:\/\/webninjataylor.com\/library\/?p=3048"},"modified":"2014-06-24T20:55:38","modified_gmt":"2014-06-24T20:55:38","slug":"custom-links-in-wordpress-admin-bar","status":"publish","type":"post","link":"https:\/\/webninjataylor.com\/library\/custom-links-in-wordpress-admin-bar\/","title":{"rendered":"Custom Links in WordPress Admin Bar"},"content":{"rendered":"<p>Add to the theme&#8217;s functions.php file&#8230;<\/p>\n<pre>function admin_bar_custom_links(){\r\n    global $wp_admin_bar;\r\n    if(!is_super_admin() || !is_admin_bar_showing()){\r\n        return;\r\n    }\r\n    $wp_admin_bar-&gt;add_menu(array(\r\n        'id'    =&gt; 'all_posts',\r\n        'title' =&gt; __('All Posts'),\r\n        'href'  =&gt; __('http:\/\/webninjataylor.com\/library\/wp-admin\/edit.php'),\r\n    ));\r\n    \/\/ Add sub menu link\r\n    $wp_admin_bar-&gt;add_menu( array(\r\n        'parent'    =&gt; 'all_posts',\r\n        'id'        =&gt; 'all_pages',\r\n        'title'     =&gt; __( 'All Pages'),\r\n        'href'      =&gt; __('http:\/\/webninjataylor.com\/library\/wp-admin\/edit.php?post_type=page'),\r\n    ));\r\n}\r\nadd_action('admin_bar_menu','admin_bar_custom_links',25);\r\n<\/pre>\n<p>Change parent, id, title, and href<\/p>\n<h2>Resources<\/h2>\n<ul>\n<li><a href=\"http:\/\/sumtips.com\/2011\/03\/customize-wordpress-admin-bar.html\" target=\"_blank\">SumTips.com<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Add to the theme&#8217;s functions.php file&#8230; function admin_bar_custom_links(){ global $wp_admin_bar; if(!is_super_admin() || !is_admin_bar_showing()){ return; } $wp_admin_bar-&gt;add_menu(array( &#8216;id&#8217; =&gt; &#8216;all_posts&#8217;, &#8216;title&#8217; =&gt; __(&#8216;All Posts&#8217;), &#8216;href&#8217; =&gt; __(&#8216;http:\/\/webninjataylor.com\/library\/wp-admin\/edit.php&#8217;), )); \/\/ Add sub menu link $wp_admin_bar-&gt;add_menu( array( &#8216;parent&#8217; =&gt; &#8216;all_posts&#8217;, &#8216;id&#8217; =&gt; &#8216;all_pages&#8217;, &#8216;title&#8217; =&gt; __( &#8216;All Pages&#8217;), &#8216;href&#8217; =&gt; __(&#8216;http:\/\/webninjataylor.com\/library\/wp-admin\/edit.php?post_type=page&#8217;), )); } add_action(&#8216;admin_bar_menu&#8217;,&#8217;admin_bar_custom_links&#8217;,25); Change parent, id, title, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[144],"tags":[5],"class_list":["post-3048","post","type-post","status-publish","format-standard","hentry","category-web-shots","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/posts\/3048","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/comments?post=3048"}],"version-history":[{"count":10,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/posts\/3048\/revisions"}],"predecessor-version":[{"id":3328,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/posts\/3048\/revisions\/3328"}],"wp:attachment":[{"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/media?parent=3048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/categories?post=3048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/tags?post=3048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}