Add “Editorial Calendar” to WordPress Admin Bar

I went looking for a plugin to do this and fell short.

The Admin Bar at the top of the page on a wordpress site is useful – but the one link I always ended up diving onto the dashboard page for was the Editorial Calendar Plugin – a calendar plugin that shows and schedules posts over time.

Instead of clicking

[Site Name] -> Dashboard (refresh to admin dashboard) -> Posts -> (drop down) Calendar

OR

[Site Name] -> Dashboard (refresh to admin dashboard) -> Posts (click and expand menu in sidebar) -> Calendar,

this code adds a link directly to the editorial calendar at the top of the page in the admin bar, next to “+New”.

Code (add at the end of functions.php for your theme):

// add a link to the WP Toolbar
function custom_toolbar_link($wp_admin_bar) {
    $args = array(
        'id' => 'calendar',
        'title' => 'Editorial Calendar',
        'href' => '/wp-admin/edit.php?page=cal',
        'meta' => array(
            'class' => 'calendar',
            'title' => 'Editorial Calendar'
            )
    );
    $wp_admin_bar->add_node($args);
}
add_action('admin_bar_menu', 'custom_toolbar_link', 999);

adds “Editorial Calendar” link:

which sends you directly to:

— doug