Plugins extend and expand the functionality of WordPress..There are tens of thousands of plugins which you can use to install to your wordpress site.In this article, we will introduce how to create a basic wordpress plugin.
1.Create a php file.
You can create a simple empty notepad text document and change the extension from .txt to .php when you save it.
2.Add these snippet to your txt file
/** * Plugin Name: Your_Plugin * Plugin URI: https://yourwebsite.com * Description: Your first wordpress plugin * Version: 1.0 * Author: WordPress Contributors * Author URI: https://yourwebsite.com * Text Domain: your first wordpress plugin * Domain Path: /languages */
After you save the notepad text document with .php extension, you can upload it to your hosting. For example, you can save it as my_first_plugin.php
3.Upload it to public/wp-content/plugins
You can use a ftp software to upload document my_first_plugin.php to the folder Public/wp-content/plugins.
Or you are using cpanel, you can upload it directly by cpanel. It’s easy. See the picture as below.
4.Go to wordpress dashboard,go to plugins and activate the plugin you just upload.
You can activate it.After the activation of your first plugin, you can see it in your plugin list. You can see the custom plugin name, custom plugin description, version,author and link to author’s website.However, this is an empty plugin. If you want to add some features to the plugin, you need to add specific code to the php document you just upload.