0  0 2017-01-09 09:35:58

WordPress Plugins:
WordPress is mainly divided into 
a) Core
b) Themes
c) Plugins

Importance of Plugins:
Core WordPress files can’t be modified.  Because if wordpress is updated to new version it overwrites all core files. Hence if you want to add any additional functionality the plugins are used. The simple form of plugin is single PHP file. Hence more functionality can be added with the help of plugins using approved wordpress API’s. The plugin PHP file just requires a Plugin Header, a couple of PHP functions, and some kind hooks to attach your functions to. Hence plugins provide wider area without interfering core files.

Getting started with plugins:
Follow the procedures to install wordpress plugins
a. Navigate to your WordPress installation’s wp-content directory.
b. Open the plugins directory.
c. Create a new directory and name it after your plugin (e.g. plugin-name).
d. Open your new plugin’s directory.
e. Create a new PHP file (it’s also good to name this file after your plugin, e.g. plugin-name.php).

Follow the process similar to command prompt
a. WordPress$ cd wp-content
b. wp-content$ cd plugins
c. plugins$ mkdir plugin-name
d. plugins$ cd plugin-name
e. plugin-name$ vi plugin-name.php

In above examples vi is an editor. You can add any editor you want. Now that you’re editing your new plugin’s PHP file, you’ll need to add a plugin header comment.  This is a specially formatted PHP block comment that contains metadata about your plugin, such as its name and author.  At the very least, the plugin header comment must contain the name of your plugin.  Only one file in your plugin’s folder should have the header comment—if your plugin has multiple PHP files, only one of those files should have the comment.
        Plugin Name: Your Plugin Name

After you save the file, you should be able to see your plugin listed in your WordPress site. Log in to your WordPress site, and click Plugins on the left navigation pane of your WordPress Admin. This page displays a listing of all the plugins your WordPress site has. Your new plugin should now be in that list.

Hooks: Actions and filters
There are mainly two types of hooks in Wordpress Plugin
a. Actions
b. filters
a. Actions:  Actins work as they can add or change WordPress functionality, and filters allow to change content  as it is displayed on website.

Comments (0)

Post Your Comments


Hong Kong Office

Find Us On

Website Development Company
Digital Marketing
website development company in Hong Kong
website designer in pune