Add Custom Menu in admin area WordPress


Create file test.php and copy past following code inside.

put file in wodpress plugin directory

<?php
/*
Plugin Name: Custom Admin Menus
Plugin URI:
Description: Simple demo of admin menus
Author: yogs174
Version: 1.0
Author URI: https://yogs174.wordpress.com/
*/

add_action('admin_menu', 'yogs174_admin_menu_create');

function yogs174_admin_menu_create() {

	add_utility_page('Yogs174 Top', 'Yogs174 Top', 'manage_options', 'y174_top' , '', '', 81 );

	add_submenu_page('y174_top', 'One', 'One', 'manage_options', 'y174_top', 'y174_one_func');
	add_submenu_page('y174_top', 'Two', 'Two', 'manage_options', 'y174_two', 'y174_two_func');
	add_submenu_page('y174_top', 'three', 'three', 'manage_options', 'y174_three', 'y174_three_fun');
}

function y174_one_func() {
	echo "Admin One";
}

function y174_two_func() {
	echo "Admin Two";
}

function y174_three_fun() {
	echo "Admin Three";
}

?>
Advertisements

Author: yogs174

I am programmer and entrepreneur and love innovative stuff. I like to work on different technologies with new tools.

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