Add items in menu item in wordpress

This is simple code i tell you step by step

<?php
/*
Plugin Name: Insert Page in admin menu
Plugin URI: https://rakeshkumar125.wordpress.com
Description: This plugin shows you how to add page in admin menu
Author: Rakesh Kumar
Author URI: https://rakeshkumar125.wordpress.com
*/

// Hook for adding admin menus
add_action(‘admin_menu’, ‘mt_add_pages’);

// action function for above hook
function mt_add_pages() {

// Add a new top-level menu (ill-advised):
add_menu_page(__(‘Your Menu Title’), __(‘Your Menu name’), ‘manage_options’, ‘mt-top-level-handle’, ‘mt_toplevel_page’ );

}

// mt_toplevel_page() displays the page content for the custom Test Toplevel menu
function mt_toplevel_page() {
echo ”
” . __( ‘page contents for the menu’ ) . ”
“;
}

?>

Advertisements

One thought on “Add items in menu item in wordpress

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s