The first step of creating a WordPress plugin is to create a PHP file inside of the plugins directory and add the necessary information to have it recognized by the system. This first recipe shows you how to create a basic plugin file for WordPress and how to see and activate this new extension from the administration interface.
You should have access to a WordPress development environment, either on your local computer or a remote server, where you will be able to load your new plugin files.
- Navigate to the WordPress plugin directory (
wp-content/plugins
) of your development installation. - Create a new subdirectory called
ch2-plugin-header
within the plugin directory. - Navigate to this directory and create a new text file called
ch2-plugin-header.php
. - Open the new file in a text editor and add the following text:
<?php /* Plugin Name: Chapter 2 - Plugin Header Plugin URI: Description: Declares a plugin that will be visible in the...