How to Create Custom plugin in wordpress

Create Custom Plugin :

Now a day’s lot of wordpress plugins is available. Despite, Some time we want to create some custom plugin as per our requirement. So now here we will see how to create a plugin in wordpress.

Step : 1 Create one directory from plugins folders.

Step : 2 Directory name : MypluginName

Step : 3 Create a one file name called : myfilename.php

Add below code in your php file

/*
Plugin Name: MypluginName
Plugin URI: MyURL
Description: Here my plugin descriptions
Author: MyName
Version: 1.0
Author URI: Mywebsite URL
*/
add_action(‘admin_menu’, Name_of_first_function);
function Name_of_first_function () {
add_options_page(‘My Plugin Options’, Adminpaneldisplayname, ‘administrator’, displayname, Name_of_second_function);
}
function Name_of_second_function () {
if (!current_user_can(‘administrator’)) {
wp_die( __(‘You do not have sufficient permissions to access this page.’) );
}

echo ‘<p>You can write your own code.</p>’;

}

After done the above steps,do

1. Open Admin Panel -> Click Installed Plugin

2. Activate your plugin

3. After activated your plugin you will get, your plugin link from left menu side bar.

4. Done