Welcome to the introduction to developing WordPress plugins.
WordPress plugin is a package of code that could be installed on a WordPress website to add new features or functionality.
Whereas themes are used to control the look and feel of a WordPress site, plugins are used to add or extend its functionality.
As a WordPress developer, you will often need to create custom functionality for a WordPress site.
While it is possible to add this functionality to a theme or child themes functions.php file,
it often makes more sense to add this code to a WordPress plugin.
This is because a plugin can be activated or deactivated without affecting the theme.
Not only that, but your plugin could be used across multiple sites.
The WordPress plugin directory contains over 50,000 plugins that can be installed on a WordPress site.
These plugins can turn a WordPress site into an online store, a social network, a learning management system and so much more.
Most WordPress plugins in the plugin directory are composed of many files,
but to create a valid plugin you only really need one main PHP file with a specifically formatted comment block at the top of that file.
When installed, plugins exist in the WP content plugins directory of a WordPress install.
HelloDolly, one of the first plugins for WordPress, is an example of a single file plugin.
All functionality of the plugin is contained in a single PHP file called hello.php.
Akismet, an anti-spam plugin for WordPress, is an example of a multi-plugin file.
Here, the Akismet directory contains all the files for the plugin.
The main file for the plugin is akismet.php, and it handles the loading of all the other required files.
The WordPress plugin developer handbook is a great resource for learning how to create a WordPress plugin.
It contains information on how to create a plugin, how to use the various WordPress APIs, and how to submit a plugin to the WordPress plugin directory.
You can find the plugin developer handbook by visiting developer.wordpress.org and clicking on the plugins link at the top of the page.