Basic Plugin Development in WordPress

Plugin Dev

If you are familiar with the WordPress platform, you are most likely familiar with plugins too. As the official WordPress says: Plugins are the ways to extend & add to the functionality that already exists in WordPress site. WordPress plugins are the PHP scripts that can alter your website. The changes could be anything from the simplest tweak in the header to a more drastic redefine.

How Plugins Work: An Introduction to Hooks, Actions, & Filters

Now, it’s time to get a little more technical Knowledge. Plugins literally ‘plug in’ to the WordPress core. This is done using ‘hooks,’ which enable one piece of code to interact with another.
  • Actions: These are used to add or change WordPress functionality.
  • Filters: These are used to alter the functionality of actions.
As you can probably guess, there’s a lot more to how hooks actually work. However, this should give you a rough idea of how the two differ. For now, this is all you’ll need to know, but we recommend that you read up on all the hook types in the Plugin Developer Handbook.

Step 1: Create a folder in your plugin directory :

Go ahead and create a new folder, giving it a unique name using lowercase letters and dashes such as my-first-plugin. Once you’ve done that, enter your new folder and move on to the next step.

Step 2: Create the main PHP file for your plugin :

Next, you will need to create the main file for your plugin. I.e, Create a PHP file within your new plugin folder and give it the same name such as my-first-plugin.php. After you’ve done that, open your plugin’s main file and get ready to do some editing.
Step 3: Setup your plugin’s information :
 * Plugin Name: Plugin Name
 * Plugin URI: Plugin URL
 * Description: The very first plugin that I have ever created.
 * Version: 1.0
 * Author: Your Name
 * Author: URI
Step 3: Hook Your plugin name in WP – admin Dashboard :
add_action('admin_menu', 'registrationworkflow');
function registrationworkflow(){
   add_menu_page('Registration Workflow', 'Registration Workflow', 'manage_options', 'my-menu', 'my_menu_output' );
function my_menu_output()
echo "your code";

About the author


A coder who is trying to solve some problems via "Procoders", Software Engineer By Profession, WEB Enthusiast, Hobby Blogger. I love to share Tech Ideas and like to learn and explore new things and Technologies.

Add Comment

Click here to post a comment