Javascript,Nodejs,MongodDB,WordPress,CSS,PHP

LightBlog

Thursday, November 1, 2018

How to Develop Plugins



1) In your active theme create a folder inside your plugin folder and write plugin name
exp:contact-us

2) create a file same name as your folder name in our case plugin folder  name is contact-us
contact-us.php
3) inside contact-us.php file first of in top of file wirte header of plugin just same as
/*
* Plugin Name: contact us
* Description: something about your plugin what is the use of this plugin
*/

4) during develop plugin we need these file to include which is core file of wordpress
- functions.php
- wp-load.php
- wp-config.php
- wp-db.php
- plugable.php

5) include these file just like this: require_once(ABSPATH.'/wp-admin/wp-db.php')
6) now we need to add menu for our dashboard section inside wordpress admin
register menu for dashboard with the help of add_menu_page() method then hook it usign add_action('admin_menu')
7)

No comments:

Post a Comment