{"id":113,"date":"2014-09-27T09:20:45","date_gmt":"2014-09-27T09:20:45","guid":{"rendered":"https:\/\/www.codexworld.com\/?p=113"},"modified":"2015-04-13T20:03:45","modified_gmt":"2015-04-13T20:03:45","slug":"create-a-custom-wordpress-plugin-from-scratch","status":"publish","type":"post","link":"https:\/\/www.codexworld.com\/create-a-custom-wordpress-plugin-from-scratch\/","title":{"rendered":"Create a custom WordPress Plugin from scratch"},"content":{"rendered":"<p>WordPress is the most popular open source content management system for today&#8217;s world web application. WordPress Plugins allow easy modification, customization, and enhancement of a WordPress blog. A WordPress Plugin is a program, or a set of one or more functions, written in the PHP, that adds a specific set of features or services to the WordPress without changing the core programming of WordPress.<\/p>\n<p>In this tutorial we will describe the creation of a custom WordPress Plugin from the scratch. WordPress Developers can learn how to create custom WordPress Plugin. The following step by step tutorial has made the custom WordPress plugin development process very simple. You can easily create WordPress plugin with our tutorial. Let&#8217;s start the WordPress Plugin creation tutorial.<\/p>\n<h2>1) Plugin Directory Creation:<\/h2>\n<p> Create a directory with your Plugin name.(Like : <code>myPlugin\/<\/code>)<\/p>\n<ul class=\"folder_structure\">\n<li><b>myPlugin\/<\/b><\/li>\n<\/ul>\n<h2>2) Main Plugin File:<\/h2>\n<p> In the Plugin directory (<code>myPlugin\/<\/code>) create a PHP file with the same name of the Plugin directory(Like : <code>myPlugin.php<\/code>).<\/p>\n<ul class=\"folder_structure\">\n<li><b>myPlugin\/<\/b>\n<ul>\n<li><code>myPlugin.php<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>3) <code>myPlugin.php<\/code> File:<\/h2>\n<p> In this file you need to write some codes and functions.<\/p>\n<ul>\n<li><span class=\"glyphicon glyphicon-forward\"><\/span>This file must contain a standard Plugin information header. The information should be given into the comment tags.\n<pre><span style=\"color: #000000\"><span style=\"color: #FF8000\">\/**<br \/>&nbsp;*&nbsp;Plugin&nbsp;Name:&nbsp;Name&nbsp;Of&nbsp;The&nbsp;Plugin<br \/>&nbsp;*&nbsp;Plugin&nbsp;URI:&nbsp;http:\/\/URI_Of_Page_Describing_Plugin_and_Updates<br \/>&nbsp;*&nbsp;Description:&nbsp;A&nbsp;brief&nbsp;description&nbsp;of&nbsp;the&nbsp;Plugin.<br \/>&nbsp;*&nbsp;Version:&nbsp;The&nbsp;Plugin's&nbsp;Version&nbsp;Number,&nbsp;e.g.:&nbsp;1.0<br \/>&nbsp;*&nbsp;Author:&nbsp;Name&nbsp;Of&nbsp;The&nbsp;Plugin&nbsp;Author<br \/>&nbsp;*&nbsp;Author&nbsp;URI:&nbsp;http:\/\/URI_Of_The_Plugin_Author<br \/>&nbsp;*&nbsp;License:&nbsp;A&nbsp;\"Slug\"&nbsp;license&nbsp;name&nbsp;e.g.&nbsp;GPL2<br \/>&nbsp;*\/<\/span>&nbsp;<\/span>    \t<\/pre>\n<\/li>\n<li><span class=\"glyphicon glyphicon-forward\"><\/span>If your Plugin have any function that interact with the database, then declare the <code>$wpdb<\/code>.\n<pre><span style=\"color: #000000\"><span style=\"color: #007700\">global&nbsp;<\/span><span style=\"color: #0000BB\">$wpdb<\/span><span style=\"color: #007700\">;<\/span><\/span><\/pre>\n<\/li>\n<li><span class=\"glyphicon glyphicon-forward\"><\/span>If you want to create some user defined functions, then create <b>functions.php<\/b> file and include it.\n<pre><span style=\"color: #000000\"><span style=\"color: #007700\">include&nbsp;<\/span><span style=\"color: #DD0000\">\"functions.php\"<\/span><span style=\"color: #007700\">;<\/span>&nbsp;<\/span><\/pre>\n<\/li>\n<li><span class=\"glyphicon glyphicon-forward\"><\/span>Declare the <code>add_action()<\/code> function : <code>add_action()<\/code> function Hooks a function on to a specific action.\n<pre><span style=\"color: #000000\"><span style=\"color: #FF8000\">\/\/add_action(&nbsp;$tag,&nbsp;$function_to_add,&nbsp;$priority,&nbsp;$accepted_args&nbsp;);<br \/><\/span><span style=\"color: #0000BB\">add_action<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'admin_menu'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'myplugin_menu'<\/span><span style=\"color: #007700\">);<\/span>&nbsp;<\/span><\/pre>\n<\/li>\n<li><span class=\"glyphicon glyphicon-forward\"><\/span>Now declare the function which you previously added into <code>add_action()<\/code> function.\n<pre><span style=\"color: #000000\"><span style=\"color:#007700\">function&nbsp;<\/span><span style=\"color: #0000BB\">myplugin_menu<\/span><span style=\"color: #007700\">(){<br \/>}<\/span><\/span><\/pre>\n<\/li>\n<\/ul>\n<h2>4) <code>myplugin_menu()<\/code> function:<\/h2>\n<ul>\n<li><span class=\"glyphicon glyphicon-forward\"><\/span><b>Declare the <code>add_menu_page()<\/code> function :<\/b> <code>add_menu_page()<\/code> function  creates a new top level menu section in the admin menu sidebar and registers a hook to callback your function for outputting the page content when the linked menu page is requested.\n<pre><span style=\"color: #000000\"><span style=\"color: #FF8000\">\/\/add_menu_page(&nbsp;$page_title,&nbsp;$menu_title,&nbsp;$capability,&nbsp;$menu_slug,&nbsp;$function,&nbsp;$icon_url,&nbsp;$position&nbsp;);<br \/><\/span><span style=\"color: #0000BB\">add_menu_page<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'&nbsp;My&nbsp;Plugin'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'&nbsp;My&nbsp;Plugin&nbsp;'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'administrator'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'myplugin_settings'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'myplugin_&nbsp;menu_page'<\/span><span style=\"color: #007700\">);<\/span>&nbsp;<\/span><\/pre>\n<\/li>\n<li><span class=\"glyphicon glyphicon-forward\"><\/span><b>Declare the <code>add_submenu_page()<\/code> function :<\/b> <code>add_submenu_page()<\/code> function add a sub menu page.\n<pre><span style=\"color: #000000\"><span style=\"color: #FF8000\">\/\/add_submenu_page(&nbsp;$parent_slug,&nbsp;$page_title,&nbsp;$menu_title,&nbsp;$capability,&nbsp;$menu_slug,&nbsp;$function&nbsp;);<br \/><\/span><span style=\"color: #0000BB\">add_submenu_page<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'myplugin_settings'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'My&nbsp;Plugin&nbsp;Submenu'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'My&nbsp;Plugin&nbsp;Submenu'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'administrator'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'myproject_submenu'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'myproject_submenu_page'<\/span><span style=\"color: #007700\">);<\/span>&nbsp;<\/span><\/pre>\n<\/li>\n<\/ul>\n<h2>5) Database Table Creation :<\/h2>\n<p> If you want to create table at the database for your plugin, then follow the below steps.<\/p>\n<ul>\n<li><span class=\"glyphicon glyphicon-forward\"><\/span>At first declared a user defined function like <code>install_tables()<\/code>.Then you should be declared <code>global $wpdb;<\/code> and include upgrade.php file for database connection. After that assign a variable with the value of the create table SQL and pass this variable into the <code>dbDelta()<\/code> function.\n<pre><span style=\"color: #000000\"><span style=\"color: #007700\">function&nbsp;<\/span><span style=\"color: #0000BB\">instal_tables<\/span><span style=\"color: #007700\">()<br \/>{<br \/>&nbsp;&nbsp;&nbsp;&nbsp;global&nbsp;<\/span><span style=\"color: #0000BB\">$wpdb<\/span><span style=\"color: #007700\">;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;require_once(<\/span><span style=\"color: #0000BB\">ABSPATH&nbsp;<\/span><span style=\"color: #007700\">.&nbsp;<\/span><span style=\"color: #DD0000\">'wp-admin\/includes\/upgrade.php'<\/span><span style=\"color: #007700\">);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$table1&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"CREATE&nbsp;TABLE&nbsp;\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$wpdb<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">prefix<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\"table_name&nbsp;(<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`id`&nbsp;bigint(100)&nbsp;NOT&nbsp;NULL&nbsp;AUTO_INCREMENT,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`name`&nbsp;varchar(255)&nbsp;NOT&nbsp;NULL,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`email`&nbsp;varchar(255)&nbsp;NOT&nbsp;NULL,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PRIMARY&nbsp;KEY&nbsp;&nbsp;(`id`)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)&nbsp;ENGINE=InnoDB&nbsp;DEFAULT&nbsp;CHARSET=utf8&nbsp;COLLATE=utf8_unicode_ci\"<\/span><span style=\"color: #007700\">;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">dbDelta<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$table1<\/span><span style=\"color: #007700\">);&nbsp;<br \/>}<\/span>&nbsp;<\/span><\/pre>\n<\/li>\n<li><span class=\"glyphicon glyphicon-forward\"><\/span>Now declare the <code>register_activation_hook()<\/code> function and pass the previously declared function into <code>register_activation_hook()<\/code>.\n<pre><span style=\"color: #000000\"><span style=\"color: #0000BB\">register_activation_hook<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">__FILE__<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #DD0000\">'instal_tables'<\/span><span style=\"color: #007700\">);<\/span>&nbsp;<\/span><\/pre>\n<\/li>\n<\/ul>\n<h2>6) Page view : <\/h2>\n<p>Now create a directory under the Plugin directory. Then create a PHP file for page view and insert this file into the newly created directory. For better understanding please follow the below file structure. <\/p>\n<ul class=\"folder_structure\">\n<li><b>myPlugin\/<\/b>\n<ul>\n<li><code>myPlugin.php<\/code><\/li>\n<li><b>pages\/<\/b>\n<ul>\n<li><code>myplugin_menu_page_view.php<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><\/p>\n<ul>\n<li><span class=\"glyphicon glyphicon-forward\"><\/span>The <code>myplugin_menu_page_view.php<\/code> file contain menu or submenu page function.<\/li>\n<li><span class=\"glyphicon glyphicon-forward\"><\/span>This PHP file contain menu or submenus function. If you want to use this page for menu page view, then you need to declare the menu page function. If you want to use this page for submenu page view, then you need to declare the submenu page function.\n<pre><span style=\"color: #000000\"><span style=\"color: #0000BB\">&lt;?php<br \/>&nbsp;&nbsp;&nbsp;&nbsp;ob_start<\/span><span style=\"color: #007700\">();<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/admin&nbsp;menu&nbsp;page&nbsp;function<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">function&nbsp;<\/span><span style=\"color: #0000BB\">myplugin_menu_page<\/span><span style=\"color: #007700\">()<br \/>&nbsp;&nbsp;&nbsp;&nbsp;{<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/for&nbsp;db&nbsp;connection<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">global&nbsp;<\/span><span style=\"color: #0000BB\">$wpdb<\/span><span style=\"color: #007700\">;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<br \/><\/span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--&nbsp;Page&nbsp;HTML&nbsp;goes&nbsp;here&nbsp;--&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h1&gt;This&nbsp;is&nbsp;my&nbsp;Plugin&nbsp;menu&nbsp;page&lt;\/h1&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000BB\">&lt;?php<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">}<br \/><\/span><span style=\"color: #0000BB\">?&gt;<\/span>&nbsp;<\/span><\/pre>\n<\/li>\n<\/ul>\n<h2>7) Include view pages<\/h2>\n<p> Include all files which are contains the menu and submenu page functions.<\/p>\n<pre><span style=\"color: #000000\"><span style=\"color: #007700\">include&nbsp;<\/span><span style=\"color: #DD0000\">\"pages\/myplugin_menu_page_view.php\"<\/span><span style=\"color: #007700\">;<br \/>include&nbsp;<\/span><span style=\"color: #DD0000\">\"pages\/myplugin_submenu_page_view.php\"<\/span><span style=\"color: #007700\">;<\/span>&nbsp;<\/span><\/pre>\n<h2>8) Congratulation!<\/h2>\n<p> Plugin creation has been completed. Whole plugin folders and files structure is given below.<\/p>\n<ul class=\"folder_structure\">\n<li><b>myPlugin\/<\/b>\n<ul>\n<li><code>myPlugin.php<\/code><\/li>\n<li><b>pages\/<\/b>\n<ul>\n<li><code>myplugin_menu_page_view.php<\/code><\/li>\n<\/ul>\n<ul>\n<li><code>myplugin_submenu_page_view.php<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>9) Installation :<\/h2>\n<p> Now with two ways you can set up your Plugin at the WordPress. <\/p>\n<ul>\n<li><span class=\"glyphicon glyphicon-forward\"><\/span>First, you can copy the whole plugin folder and paste it into the WordPress Plugins directory (<b>wp-content\/plugins<\/b>).<\/li>\n<li><span class=\"glyphicon glyphicon-forward\"><\/span>Second, you can make a zip of your plugin folder and upload your Plugin zip from the wp admin panel.(login to the wp admin panel => click on the <b>Plugins<\/b> link from the left menu section => click the <b>Add New<\/b> => upload your Plugin => active your plugin)<\/li>\n<\/ul>\n<p>\n<span class=\"glyphicon glyphicon-hand-right\"><\/span>&nbsp;We have been completed the custom WordPress Plugin creation tutorials. If you have any query about this tutorial and scripts, feel free to comment here.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress is the most popular open source content management system for today&#8217;s world web application. WordPress Plugins allow easy modification, customization, and enhancement of a WordPress blog. A WordPress Plugin is a program, or a <\/p>\n","protected":false},"author":1,"featured_media":519,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5],"tags":[],"class_list":["post-113","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","cat-5-id","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Create a custom WordPress Plugin from scratch - CodexWorld<\/title>\n<meta name=\"description\" content=\"Custom WordPress Plugin creation tutorial - How to create a custom WordPress Plugin from the scratch. WordPress Plugin development tutorial for beginners.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codexworld.com\/create-a-custom-wordpress-plugin-from-scratch\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create a custom WordPress Plugin from scratch - CodexWorld\" \/>\n<meta property=\"og:description\" content=\"Custom WordPress Plugin creation tutorial - How to create a custom WordPress Plugin from the scratch. WordPress Plugin development tutorial for beginners.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codexworld.com\/create-a-custom-wordpress-plugin-from-scratch\/\" \/>\n<meta property=\"og:site_name\" content=\"CodexWorld\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:published_time\" content=\"2014-09-27T09:20:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-04-13T20:03:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/wordpress-custom-plugin-development-by-codexworld.png\" \/>\n\t<meta property=\"og:image:width\" content=\"457\" \/>\n\t<meta property=\"og:image:height\" content=\"241\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CodexWorld\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codexworldblog\" \/>\n<meta name=\"twitter:site\" content=\"@codexworldweb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CodexWorld\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-a-custom-wordpress-plugin-from-scratch\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-a-custom-wordpress-plugin-from-scratch\\\/\"},\"author\":{\"name\":\"CodexWorld\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\"},\"headline\":\"Create a custom WordPress Plugin from scratch\",\"datePublished\":\"2014-09-27T09:20:45+00:00\",\"dateModified\":\"2015-04-13T20:03:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-a-custom-wordpress-plugin-from-scratch\\\/\"},\"wordCount\":595,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-a-custom-wordpress-plugin-from-scratch\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/wordpress-custom-plugin-development-by-codexworld.png\",\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/create-a-custom-wordpress-plugin-from-scratch\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-a-custom-wordpress-plugin-from-scratch\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/create-a-custom-wordpress-plugin-from-scratch\\\/\",\"name\":\"Create a custom WordPress Plugin from scratch - CodexWorld\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-a-custom-wordpress-plugin-from-scratch\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-a-custom-wordpress-plugin-from-scratch\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/wordpress-custom-plugin-development-by-codexworld.png\",\"datePublished\":\"2014-09-27T09:20:45+00:00\",\"dateModified\":\"2015-04-13T20:03:45+00:00\",\"description\":\"Custom WordPress Plugin creation tutorial - How to create a custom WordPress Plugin from the scratch. WordPress Plugin development tutorial for beginners.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-a-custom-wordpress-plugin-from-scratch\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/create-a-custom-wordpress-plugin-from-scratch\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-a-custom-wordpress-plugin-from-scratch\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/wordpress-custom-plugin-development-by-codexworld.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/wordpress-custom-plugin-development-by-codexworld.png\",\"width\":457,\"height\":241,\"caption\":\"wordpress-custom-plugin-development-by-codexworld\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-a-custom-wordpress-plugin-from-scratch\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codexworld.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a custom WordPress Plugin from scratch\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"name\":\"CodexWorld\",\"description\":\"Web &amp; Mobile App Development Company\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codexworld.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\",\"name\":\"CodexWorld\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"width\":200,\"height\":19,\"caption\":\"CodexWorld\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldweb\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/codexworld\",\"https:\\\/\\\/www.youtube.com\\\/codexworld\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\",\"name\":\"CodexWorld\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"caption\":\"CodexWorld\"},\"description\":\"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.\",\"sameAs\":[\"http:\\\/\\\/www.codexworld.com\",\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldblog\"],\"url\":\"https:\\\/\\\/www.codexworld.com\\\/author\\\/nitya192265\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create a custom WordPress Plugin from scratch - CodexWorld","description":"Custom WordPress Plugin creation tutorial - How to create a custom WordPress Plugin from the scratch. WordPress Plugin development tutorial for beginners.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codexworld.com\/create-a-custom-wordpress-plugin-from-scratch\/","og_locale":"en_US","og_type":"article","og_title":"Create a custom WordPress Plugin from scratch - CodexWorld","og_description":"Custom WordPress Plugin creation tutorial - How to create a custom WordPress Plugin from the scratch. WordPress Plugin development tutorial for beginners.","og_url":"https:\/\/www.codexworld.com\/create-a-custom-wordpress-plugin-from-scratch\/","og_site_name":"CodexWorld","article_publisher":"https:\/\/www.facebook.com\/codexworld","article_author":"https:\/\/www.facebook.com\/codexworld","article_published_time":"2014-09-27T09:20:45+00:00","article_modified_time":"2015-04-13T20:03:45+00:00","og_image":[{"width":457,"height":241,"url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/wordpress-custom-plugin-development-by-codexworld.png","type":"image\/png"}],"author":"CodexWorld","twitter_card":"summary_large_image","twitter_creator":"@codexworldblog","twitter_site":"@codexworldweb","twitter_misc":{"Written by":"CodexWorld","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codexworld.com\/create-a-custom-wordpress-plugin-from-scratch\/#article","isPartOf":{"@id":"https:\/\/www.codexworld.com\/create-a-custom-wordpress-plugin-from-scratch\/"},"author":{"name":"CodexWorld","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0"},"headline":"Create a custom WordPress Plugin from scratch","datePublished":"2014-09-27T09:20:45+00:00","dateModified":"2015-04-13T20:03:45+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codexworld.com\/create-a-custom-wordpress-plugin-from-scratch\/"},"wordCount":595,"commentCount":4,"publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"image":{"@id":"https:\/\/www.codexworld.com\/create-a-custom-wordpress-plugin-from-scratch\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/wordpress-custom-plugin-development-by-codexworld.png","articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.codexworld.com\/create-a-custom-wordpress-plugin-from-scratch\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.codexworld.com\/create-a-custom-wordpress-plugin-from-scratch\/","url":"https:\/\/www.codexworld.com\/create-a-custom-wordpress-plugin-from-scratch\/","name":"Create a custom WordPress Plugin from scratch - CodexWorld","isPartOf":{"@id":"https:\/\/www.codexworld.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codexworld.com\/create-a-custom-wordpress-plugin-from-scratch\/#primaryimage"},"image":{"@id":"https:\/\/www.codexworld.com\/create-a-custom-wordpress-plugin-from-scratch\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/wordpress-custom-plugin-development-by-codexworld.png","datePublished":"2014-09-27T09:20:45+00:00","dateModified":"2015-04-13T20:03:45+00:00","description":"Custom WordPress Plugin creation tutorial - How to create a custom WordPress Plugin from the scratch. WordPress Plugin development tutorial for beginners.","breadcrumb":{"@id":"https:\/\/www.codexworld.com\/create-a-custom-wordpress-plugin-from-scratch\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codexworld.com\/create-a-custom-wordpress-plugin-from-scratch\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/create-a-custom-wordpress-plugin-from-scratch\/#primaryimage","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/wordpress-custom-plugin-development-by-codexworld.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/wordpress-custom-plugin-development-by-codexworld.png","width":457,"height":241,"caption":"wordpress-custom-plugin-development-by-codexworld"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codexworld.com\/create-a-custom-wordpress-plugin-from-scratch\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codexworld.com\/"},{"@type":"ListItem","position":2,"name":"Create a custom WordPress Plugin from scratch"}]},{"@type":"WebSite","@id":"https:\/\/www.codexworld.com\/#website","url":"https:\/\/www.codexworld.com\/","name":"CodexWorld","description":"Web &amp; Mobile App Development Company","publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codexworld.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codexworld.com\/#organization","name":"CodexWorld","url":"https:\/\/www.codexworld.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","width":200,"height":19,"caption":"CodexWorld"},"image":{"@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldweb","https:\/\/www.linkedin.com\/company\/codexworld","https:\/\/www.youtube.com\/codexworld"]},{"@type":"Person","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0","name":"CodexWorld","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","caption":"CodexWorld"},"description":"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.","sameAs":["http:\/\/www.codexworld.com","https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldblog"],"url":"https:\/\/www.codexworld.com\/author\/nitya192265\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/wordpress-custom-plugin-development-by-codexworld.png","jetpack_shortlink":"https:\/\/wp.me\/p6bxIh-1P","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/comments?post=113"}],"version-history":[{"count":9,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/113\/revisions"}],"predecessor-version":[{"id":521,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/113\/revisions\/521"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media\/519"}],"wp:attachment":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media?parent=113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/categories?post=113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/tags?post=113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}