- November 19, 2014
- Posted by: 1Solutions
- Category: Uncategorized, wordpress development
WordPress as many of our readers would be familiar with is a very versatile platform that can serve many a purposes. What makes WordPress so versatile is the fact that a number of different themes and Plugins are available for WordPress that help to achieve various different kinds of functionality. Today we will have a look into the WordPress Plugins and how these are developed, to be more specific.
First of all, a plug-in is basically a piece of code that hooks on to the WordPress install and serves to add some new functionality or purpose over and above that provided by WordPress itself. A plug-in can e defined as a tool that extends the functionality provided by WordPress by offering custom functions and features so that the users may tailor their websites as per their specific requirements.
The main plug-in file must contain standards plug-in information header. Please see a sample below:
* Plugin Name: Name of the Plugin
*Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
* Description: A brief description of the Plugin.
* Version: The plugins’ Version Number, e.g.: 1.0
* Author: Name of the Plugin Author
* Author URI: http://URI_Of_The_Plugin_Author
* License: A “Slug” license name e.g. GPL2
The rest of file should make use of PHP coding, WordPress template tags and plugin hooks coding.
A brief introduction to hooks and template tags:
WordPress Plug-in hooks: The these work is that at different times while the WordPress is running WordPress checks if any plug-in has registered functions to be run at that time and if true the functions are executed. For instance, before WordPress adds the title of a post to browser output, it first checks to see if any Plugin has registered a function for the “filter” hook called “the title”. If so, the title text is passed in turn through each registered function, and the final result is what is printed.
Template Tags: A template tag is used within the WordPress templates and can be defined as a piece of code that instructs word press to do something or fetch some information. For example single_post_title() displays or returns the title for a single post.
Finally we would like to say that plug-in should be coded with the right mix of the desired elements to meet the requirements . We hope that this article helps the readers to understand the basics of WordPress plug-in development.
1Solutions is a certified WordPress designing & development company in New Delhi, India. We are providing WordPress development services, corporate websites, responsive website development services, logo design, website design services, application development & internet marketing services across the world.