Web Development & WordPress

Learning Plugins Development: Part 1

Here I am going to create a very small plugins, mainly a shortcode which will be used in any page and post and that will show the message “My First Attempt of creating plugin”.

Steps:

  1. create a folder named “test-plugin” inside plugins folder
  2. create a php file named “test-plugin.php” inside that “test-plugin” folder
  3. in that test-plugin.php put this code
<?php 
/*
Plugin Name: Test Plugin
Plugin URI: https://facebook.com
Author: Maya Nova
Author URI: https://google.com
Description: This is a test plugin

*/
function test_plugin_function(){
    ob_start();
    return "My First Attempt of creating plugin";
    ob_get_clean();
}

add_shortcode("test_plugin", "test_plugin_function");

Output

Leave a comment