Brief note of wordpress plugin
WordPress plugin is very fast and powerful object oriented base way to modify wordpress cms according to one’s own directions.
a short note on wordpress pluging functionality
A plugin in WordPress is a PHP script that extends or alters the core functionality of WordPress.
Advantages of plugin:
When we develop wordpress plugin , we do not need to modify wordpress core files as wordpress is totally object oriented base so we can overwrite functionalities via plugin or what so ever our client demands from a develper.
When we develop a plugin and hosted on wordpress plugin directory ; if the download increases or that specified wordpress developed plugin functionality increases.
that would really make site ranking as wordpress uses one’s own hosted domain directory.
How Plugins Interact with WordPress:
WordPress features many different APIs for use in plugin. Each application programming interface,
helps interact with WordPress in a different way. Following is a list of the main available APIs in WordPress and their function:
It Provides a set of hooks that enable plugins access to specific parts of WordPress. WordPress
contains two different types of hooks: Actions and Filters. The Action hook enables you to trigger custom plugin code at specific points during
For example, we can trigger a custom function to run after a user registers a user account in
WordPress. The Filter hook to modifies text before adding or after retrieving from the database.
Widgets with plugin:
Create and manage widgets in your plugin. Widgets appear under the Appearance ?
Widgets screen and are available to add to any registered sidebar in your theme. The API enables
multiple instances of the same widget to be used throughout your sidebars.
Shortcode with plugin:
Adds shortcode support to your plugin. A shortcode is a simple hook that enables you to call
a PHP function by adding something such as [shortcode] to a post or page.
Dashboard Widgets with plugin:
Creates admin dashboard widgets. Widgets automatically appear on the Dashboard of WordPress and contain all standard
customization features including minimize, drag/ drop, and screen options for hiding.
Rewrite with plugin:
Creates custom rewrite rules in your plugin. Now plugin would change htaccess file settings and what so called RewriteRule.
HTTP — Sends HTTP requests from your plugin. This API retrieves content from an external URL or for submitting content to a URL.
Settings with plugin:
Inserts settings or a settings section for your plugin. The primary advantage to using the Settings API is security. All settings data is scrubbed,
so you do not need to worry about cross site request forgery (CSRF) and cross site scripting (XSS) attacks when saving plugin settings.
Options with plugin:
It stores and retrieves options in your plugin. This API features the capability to create new options, update existing options, delete options, and retrieve any option already defined.
Database with plugin:
Accesses the WordPress database. This includes creating, updating, deleting, and retrieving database records for use in your plugins.
a simple wordpress email sending example is given below:
$email_to = ‘firstname.lastname@example.org’;
$email_subject = ‘Plugin email example’;
$email_message = ‘How do you like my new plugin?’;
wp_mail( $email_to, $email_subject, $email_message );