How to create plugin in WordPress with example

WordPress is a CMS. CMS stands for Content Management System. CMSs are helps to creating a website in easy way. Many pleople don’t know about Coding and programming languages, so WordPress help to develop their website in easy manner with less coding.

Plugins: Plugins are helps to CMS to enhance their capabilites and functionalities.
Here are some steps for creating a CRUD plugin in wordpress.

First you create a table on you existing wordpress site,

Copy below code on your phpmyadmin SQL editor.

Step1: On the first we create file named “init.php”. This is a core file of the plugin where we make menu for admin sidebar and call all functions and pages. Here are some code below,

//This comment is a very main part of the plugin development which shows like this,

/*
Plugin Name: User List
Description: A simple user list for CRUD
Version: 1.0
Author: phpcoder.tech
Author URI: http://phpcoder.tech
*/

init.php

From this INIT.PHP file you can see on your admin side bar menu name which you set on this code, look like this,

Step2:

On second step we create code for adding users to database.

create.php

Step3:

on this step we fetch the data from database which we inster using create.php code.

List.php

In this file delete operation code is also available.

Step4:

For updation of data we create the update.php file

Update.php

 

Subscribe For Latest Updates

Sign up to best of PHP Code Solutions, informed analysis and opinions on what matters to you.
Invalid email address
We promise not to spam you. You can unsubscribe at any time.

Discussion

Leave a Comment

Your email address will not be published. Required fields are marked *