Ever wondered, "What is a WordPress plugin?", "How does a WordPress plugin work?", "What does it do?" or "Why does WordPress use plugins?"? If so, then read on to learn more about WordPress plugins.
In its simplest form, a WordPress plugin is a PHP script that enables your WordPress-based site to do something more than it could without that script. A WordPress plugin extends functionality and does it so that site owners can easily enable it, disable it and configure settings to customize its behavior.
The largest repository of free WordPress plugins can be found on the wordpress.org website, though there are many paid plugin repositories like codecanyon.net and premium.wpmudev.org. Other places you'll find plugins include github.com, plugintable.com, rankwp.com, tidyrepo.com, wpnuggets.com and wpplugindirectory.org.
Though there are several different ways of installing, the most common way of adding a WordPress plugin is by:
WordPress has been built with an 2)Application Programming Interface (API) which allows plugins to tie into many of the activities of WordPress and range from page initialization to just before comments are loaded to just after something is posted. There are massive numbers of points in the system where plugins can tap into and work their magic, all based on how the developer has coded them.
Plugins can use WordPress hooks - code that allows plugins to tie into procedures without actually changing them. It's a bit like a prompt that nudges functions (code) into action when another bit of code is executed.
There are two types of hooks, filter hooks and action hooks.
Just as the name implies, a WordPress action hook is when code does something when triggered. In other words, when the hook event fires, the action is performed.
Rather than performing an action when triggered, a filter hook is designed to modify data. For example, a filter hook can rewrite text on the screen, changing greetings, titles, form fields and just about anything displayed to web visitors.
For more information, check out our guides to the WordPress database, comments, hooks, handy plugins and more throughout the wiki, blog and forums.