Create First WordPress Plugin Step by Step for Beginners

Today, We want to share with you Create First WordPress Plugin Step by Step for Beginners.In this post we will show you how to create plugin in wordpress step by step with example, hear for how to create plugin in wordpress with example we will give you demo and example for implement.In this post, we will learn about how to create custom plugin in wordpress from scratch with an example.

Create First WordPress Plugin Step by Step for Beginners

There are the Following The simple About Create First WordPress Plugin Step by Step for Beginners Full Information With Example and source code.

As I will cover this Post with live Working example to develop Writing a Simple WordPress Plugin, Beginner Tutorial, so the some major files and Directory structures for this example is following below.

Step-1 Create Simple Plugin Metadata.

Create file pakainfo-hello-world.phpb> as well as put below simple source code first.


Here below fields are absolutely required as well as should be unique to your plugin:

  • Plugin Name
  • Plugin URI
  • Description
  • Version
  • Author
  • Author URI
  • Text Domain
  • Contributors

Step-2 Add submenu section


function pakainfo_add_menu() {
    add_submenu_page("options-general.php", "Pakainfo Plugin", "Pakainfo Plugin", "manage_options", "pakainfo-hello-world", "pakainfo_hello_world_page");
}
add_action("admin_menu", "pakainfo_add_menu");

Step-3 Create plugin setting page

function pakainfo_hello_world_page()
{
?>

Hello World Plugin Template By Pakainfo

Provide any text value here for testing

Step-4 Append Saved Textfield value to each post


add_filter('the_content', 'pakainfo_com_content');
function pakainfo_com_content($content) {
    return $content . stripslashes_deep(esc_attr(get_option('pakainfo-hello-world-text')));
}

Complete code:

Here is a complete Hello World WordPress Plugin code. Just copy it below and save to file pakainfo-hello-world.php file.


Hello World Plugin Template By Pakainfo

Provide any text value here for testing

Step-5 Create readme.txt file

Here is a sample WordPress plugin readme.txt file

=== Pakainfo Hello World Plugin ===
Contributors: Pakainfo
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8ZF6WATLYFELQ
Tags: wordpress plugin example, wordpress plugin tutorial, wordpress plugin structure, step by step wordpress plugin
Requires at least: 4.5
Tested up to: 4.7.4
Stable tag: 3.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
 
Create your fist plugin. Pakainfo Hello World Plugin is the very easy WordPress plugin for step-bystep. Take this as a base plugin as well as changes as per your need.
 
== Description ==
 
Pakainfo Hello World Plugin is the very easy WordPress plugin for step-bystep if you want to start creating fresh new plugin. Take this as a base plugin as well as changes as per your need. 
 
== Installation ==
1. Unpack the `download-package`.
2. Upload the file to the `/wp-content/plugins/` directory.
3. Activate the plugin through the `Plugins` menu in WordPress.
4. Done as well as Ready.
 
== Frequently Asked Questions ==
 
= How to add FAQ question =
* just add your FAQ questions here
 
== Screenshots ==
1. This is a text label for your first screenshot
2. Add more screenshot labels as new line
 
== Changelog ==
 
= 3.0 =
* Initial release
Web Programming Tutorials Example with Demo

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Create First WordPress Plugin Step by Step for Beginners.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment