Enlaces de desarrollo de barra de administración de WP
<?php
add_action('admin_bar_menu', 'devlinks_add_toolbar_items', 90);
function devlinks_add_toolbar_items($admin_bar){
$admin_bar->add_menu( array(
'id' => 'devlinks_adminbar',
'title' => '<span class="dev-icon"></span>'.__( 'Dev Links'),
'href' => '/wp-admin',
'meta' => array(
'title' => __('Dev Links'),
),
));
$admin_bar->add_menu( array(
'id' => 'devlinks_adminbar_wpcodebox',
'parent' => 'devlinks_adminbar',
'title' => 'WPCodeBox',
'href' => '/wp-admin/admin.php?page=wpcb_menu_page_php',
'meta' => array(
'title' => __('WPCodeBox'),
'target' => '_self',
'class' => 'devlinks_adminbar_wpcodebox'
),
));
$admin_bar->add_menu( array(
'id' => 'devlinks_adminbar_automaticcss',
'parent' => 'devlinks_adminbar',
'title' => 'AutomaticCSS',
'href' => '/wp-admin/admin.php?page=automatic-css',
'meta' => array(
'title' => __('AutomaticCSS'),
'target' => '_self',
'class' => 'devlinks_adminbar_automaticcss'
),
));
$admin_bar->add_menu( array(
'id' => 'devlinks_adminbar_oxygentemplates',
'parent' => 'devlinks_adminbar',
'title' => 'Oxygen Templates',
'href' => '/wp-admin/edit.php?post_type=ct_template',
'meta' => array(
'title' => __('Oxygen Templates'),
'target' => '_self',
'class' => 'devlinks_adminbar_oxygentemplates'
),
));
$admin_bar->add_menu( array(
'id' => 'devlinks_adminbar_plugins',
'parent' => 'devlinks_adminbar',
'title' => 'Plugins',
'href' => '/wp-admin/plugins.php',
'meta' => array(
'title' => __('Plugins'),
'target' => '_self',
'class' => 'devlinks_adminbar_plugins top-separator'
),
));
$admin_bar->add_menu( array(
'id' => 'devlinks_adminbar_pages',
'parent' => 'devlinks_adminbar',
'title' => 'Pages',
'href' => '/wp-admin/edit.php?post_type=page',
'meta' => array(
'title' => __('Seiten'),
'target' => '_self',
'class' => 'devlinks_adminbar_pages'
),
));
$admin_bar->add_menu( array(
'id' => 'devlinks_adminbar_posts',
'parent' => 'devlinks_adminbar',
'title' => 'Posts',
'href' => '/wp-admin/edit.php',
'meta' => array(
'title' => __('Beiträge'),
'target' => '_self',
'class' => 'devlinks_adminbar_posts'
),
));
$admin_bar->add_menu( array(
'id' => 'devlinks_adminbar_mbposttypes',
'parent' => 'devlinks_adminbar',
'title' => 'Meta Box Post Types',
'href' => '/wp-admin/edit.php?post_type=mb-post-type',
'meta' => array(
'title' => __('Post Types'),
'target' => '_self',
'class' => 'devlinks_adminbar_mbposttypes top-separator'
),
));
$admin_bar->add_menu( array(
'id' => 'devlinks_adminbar_mbtaxonomies',
'parent' => 'devlinks_adminbar',
'title' => 'Meta Box Taxonomies',
'href' => '/wp-admin/edit.php?post_type=mb-taxonomy',
'meta' => array(
'title' => __('Taxonomies'),
'target' => '_self',
'class' => 'devlinks_adminbar_mbtaxonomies'
),
));
$admin_bar->add_menu( array(
'id' => 'devlinks_adminbar_mbcustomfields',
'parent' => 'devlinks_adminbar',
'title' => 'Meta Box Custom Fields',
'href' => '/wp-admin/edit.php?post_type=meta-box',
'meta' => array(
'title' => __('Custom Fields'),
'target' => '_self',
'class' => 'devlinks_adminbar_mbcustomfields'
),
));
}
/* Add this to your stylesheet (optional): */ /*
#wpadminbar .dev-icon:before {
font: normal 20px/1 dashicons;
content: '\f475';
position: relative;
float: left;
speak: never;
padding: 4px 0;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background-image: none !important;
margin-right: 6px;
margin-top: 2px;
}
#wp-admin-bar-devlinks_adminbar {
background: #3d4348!important;
}
#wpadminbar .top-separator {
border-top: 1px solid #4b5760;
}
*/
Juan Jose Gonzalez