Skip to content

Instantly share code, notes, and snippets.

@niraj-shah niraj-shah/wp_menu.php
Last active Aug 29, 2015

Embed
What would you like to do?
WordPress Plugin to Customise Toolbar
<?php
/**
* @package MyToolbar
*/
/*
Plugin Name: MyToolbar
Plugin URI: http://www.webniraj.com
Description: This plugin creates a custom toolbar
Version: 1.0
Author: Niraj Shah
Author URI: http://www.webniraj.com/wordpress/
*/
// function to run before menu is rendered
add_action( 'wp_before_admin_bar_render', 'preload_my_toolbar' );
// function to add items to toolbar
add_action( 'admin_bar_menu', 'my_toolbar' );
// forces toolbar to show to all users
add_filter( 'show_admin_bar', '__return_true' );
// placeholder function
function preload_my_toolbar() {
global $wp_admin_bar;
}
// placeholder function
function my_toolbar() {
global $wp_admin_bar;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.