In this blog post i am explaining how to create a custom plugin which we can use in wordpress.
For creating custom plugin first we have to create a file, here i am creating a plugin for a custom form type so i am naming the file as custom-form.php and then we have to create a folder naming custom-form-plugin within plugin folder in our wordpress theme and put custom-form.php file in it.
Now we have to write the below code into our custom-form.php file. Below comment contain our Plugin information Author name and Author URL, Plugin version, Plugin URL.
* Plugin Name: Form plugin
* Plugin URI: http://memento.com/
* Description: Custom form simple and easy to use.
* Version: 1.0
* Author: Akhil pandey
* Author URI: http://akhilpandey.com/
// Register the Form plugin
The minimum information wordpress want to set our file as plugin isPlugin Name: Form plugin. The other information will be shown inside the Admin section under the Plugins area.
With above code included in our file, save your code and explore to your WordPress admin dashboard. Click on Plugins which is on the left side of the admin dashboard, then we will see our plugin is accessible.
Adding Our Plugin Code
Now we want our custom plugin will contain a contact form for this purpose we have to put below code in our custom-form.php file.