Create a Plugin in wordpress

Create a Plugin in wordpress 

1.Create a folder and a php file in it. 

In the php file,add a comment so that wordpress identify php file as plugin. 

/* Plugin Name: DB Plugin add Menu */ 

Appropriate code can be written in the php file to achieve the functionality of plugin. Activation and deactivation hooks provide ways to perform actions when plugins are activated or deactivated. Function that have to be done upon activation of plugin should be set up using register_activation_hook().

2.Zip the folder. 

3.In wordpress dashboard,

Plugin=>Add New=>Upload Plugin=>Choose the zip file=>Install Now. 

4.Plugin is installed. Activate the plugin.

Reference :How to Create a WordPress Plugin (Step by Step for Beginners) (wpbeginner.com)

Activation / Deactivation Hooks | Plugin Developer Handbook | WordPress Developer Resources

Leave a comment

Your email address will not be published. Required fields are marked *