

{"id":263,"date":"2014-10-14T01:08:57","date_gmt":"2014-10-13T20:08:57","guid":{"rendered":"https:\/\/staging-ahmadawais.kinsta.cloud\/?p=263"},"modified":"2016-06-28T10:22:03","modified_gmt":"2016-06-28T05:22:03","slug":"coding-a-basic-shortcodes-plugin-boilerplate","status":"publish","type":"post","link":"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/","title":{"rendered":"Coding a Basic Shortcodes WordPress Plugin Boilerplate"},"content":{"rendered":"<div class=\"alert red\">T<span style=\"color: #ffffff;\">his article follows a <a style=\"color: #ffffff;\" href=\"https:\/\/github.com\/ahmadawais\/WP-Shortcode-Boilerplate\/tree\/old\">deprecated branch of AA Basic Shortcodes Boilerplate<\/a> but most of the concepts are fine. I recommend that after reading this article you take a look at the latest update of <a style=\"color: #ffffff;\" href=\"https:\/\/github.com\/ahmadawais\/WP-Shortcode-Boilerplate\/\">AA Basic Shortcodes Boilerplate<\/a>.\u00a0<\/span><\/div>\n<p><a href=\"http:\/\/codex.wordpress.org\/Shortcode_API\">Shortcode API<\/a> in WordPress is really cool. I already wrote about <a title=\"Code your first Shortcode in WordPress\" href=\"https:\/\/staging-ahmadawais.kinsta.cloud\/code-first-shortcode-wordpress\/\">coding your very first shortcode in WordPress<\/a>. Today&#8217;s discussion is about using your WordPress knowledge in the best possible way. Today I&#8217;ll be creating the same three shortcodes we created in the earlier article, but this time we\u00a0will be coding them through a WordPress plugin.<\/p>\n<h2 id=\"where-to-code-wordpress-shortcodes\">Where to Code WordPress Shortcodes?<a href=\"#where-to-code-wordpress-shortcodes\" class=\"heading-link\">#<\/a><\/h2>\n<p>Enough talk!\u00a0There are two options\u00a0when it comes to coding shortcodes in WordPress<\/p>\n<ul>\n<li>Shortcodes in functions.php<\/li>\n<li>Shortcodes in a Custom plugin<em> (<strong>Recommended<\/strong>)<\/em><\/li>\n<\/ul>\n<h3 id=\"shortcodes-in-functions-php\">\u00a0Shortcodes in functions.php<a href=\"#shortcodes-in-functions-php\" class=\"heading-link\">#<\/a><\/h3>\n<p>In a WordPress install, there is a folder wp-content which contains both the plugins &amp; themes folders. If you browse the path wp-content\/themes\/YourActivatedThemeDirectory\/ you can always find a functions.php file here. Yes! in the root of your activated theme&#8217;s folder. One can easily put the code for shortcodes in this functions.php file to create a shortcode. I wrote about this method\u00a0in\u00a0<a title=\"Code your first Shortcode in WordPress\" href=\"https:\/\/staging-ahmadawais.kinsta.cloud\/code-first-shortcode-wordpress\/\">coding your very first shortcode in WordPres<\/a>.<\/p>\n<blockquote><p>Problem?<\/p>\n<p>The problem with this method is that whenever you change your theme you end up loosing all the shortcodes. Solution to which is hunting down all the shortcodes in old theme&#8217;s functions.php file and then re-adding them to the new theme&#8217;s functions.php file. Even a beginner can sense something fishy here.<\/p><\/blockquote>\n<h3 id=\"shortcodes-in-a-custom-plugin\">Shortcodes in a Custom Plugin<a href=\"#shortcodes-in-a-custom-plugin\" class=\"heading-link\">#<\/a><\/h3>\n<p>When you create shortcodes in the form of a WordPress plugin, you never ever have to worry about them. Even when you change your theme, the plugin keeps on working, flawlessly. This is the right way of doing it.<\/p>\n<p>So, if you are a freelancer\/WordPress developer, then the very next time your client ask you to add some shortcodes in his project, do it through a plugin. I am starting a very basic plugin for\u00a0shortcodes which I will keep updating to create a full-fledged boilerplate for shortcode plugins in WordPress. But for now, it only allows you to understand the basics of creating a plugin and then using standard, organized and modular approach to executing your needs.<\/p>\n<\/section>\n<div class=\"postcontents full\">\n<p><a href=\"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Plugins-vs-Themes-WordPress.png\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-267\" src=\"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Plugins-vs-Themes-WordPress.png\" alt=\"Plugins-vs-Themes-WordPress\" width=\"800\" height=\"350\" srcset=\"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Plugins-vs-Themes-WordPress.png 800w, https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Plugins-vs-Themes-WordPress-300x131.png 300w, https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Plugins-vs-Themes-WordPress-788x344.png 788w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<section class=\"postcontents wrapper\">\n<p>Themes are used for presentation while plugins are responsible for the functionality relevant features in WordPress projects. Whenever you are building something in WordPress, think it through. Decide what is a presentation and what is functionality. Then decide what should and shouldn&#8217;t be there in theme&#8217;s functions.php file.<\/p>\n<h2 id=\"coding-a-basic-shortcodes-plugin-boilerplate\">Coding a Basic Shortcodes Plugin Boilerplate<a href=\"#coding-a-basic-shortcodes-plugin-boilerplate\" class=\"heading-link\">#<\/a><\/h2>\n<p>We are going to code a basic shortcodes plugin which will have a base plugin file and shortcodes&#8217; module files in it. Before I start, let me tell you that the base file in a WordPress plugin acts similar to functions.php in your theme. This base file can have a custom name. It can execute functions in WordPress just like the functions.php file of a theme. So, the code of shortcodes is not going to be changed. It will be similar to what I wrote about in\u00a0<a title=\"Code your first Shortcode in WordPress\" href=\"https:\/\/staging-ahmadawais.kinsta.cloud\/code-first-shortcode-wordpress\/\">code your first shortcode in WordPress<\/a>\u00a0tutorial, this tutorial is more about where to add this code and how to add it.<\/p>\n<p><a href=\"https:\/\/github.com\/ahmadawais\/AA-Basic-Shortcode-Plugin-Biolerplate\" target=\"_blank\" class=\"shortbutton green large\">Fork at Github<\/a><\/p>\n<h3 id=\"plugin-files-folders-hierarchy\">Plugin Files\/Folders Hierarchy<a href=\"#plugin-files-folders-hierarchy\" class=\"heading-link\">#<\/a><\/h3>\n<\/section>\n<div class=\"postcontents full\">\n<p><a href=\"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Files-folders.png\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-269\" src=\"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Files-folders.png\" alt=\"Files-folders\" width=\"800\" height=\"600\" srcset=\"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Files-folders.png 800w, https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Files-folders-300x225.png 300w, https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Files-folders-788x591.png 788w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<section class=\"postcontents wrapper\">\n<p>The structure of our basic plugin is as follows<\/p>\n<\/section>\n<div class=\"postcontents full dark\">\n<div class=\"wrapper\">\n<p>Folders<\/p>\n<ul>\n<li><a id=\"be4e5e1f28695b7fb9d48e6461ddf3ff-63f2be46b2856bd4d3aa585668e332f7071f7d80\" class=\"js-directory-link\" title=\"aa_basic_shortcodes\" href=\"https:\/\/github.com\/ahmadawais\/AA-Basic-Shortcode-Plugin-Biolerplate\/tree\/master\/aa_basic_shortcodes\">aa_basic_shortcodes<\/a>\u00a0Plugins folder<\/li>\n<li><a id=\"be4e5e1f28695b7fb9d48e6461ddf3ff-63f2be46b2856bd4d3aa585668e332f7071f7d80\" class=\"js-directory-link\" title=\"aa_basic_shortcodes\" href=\"https:\/\/github.com\/ahmadawais\/AA-Basic-Shortcode-Plugin-Biolerplate\/tree\/master\/aa_basic_shortcodes\">aa_basic_shortcodes<\/a>\/<a id=\"1c9221a4f3247afb4e7488da70bf6d3f-af28ee44b96a7b0a3468a6d7f654d6c2fef8946b\" class=\"js-directory-link\" title=\"shortcodes\" href=\"https:\/\/github.com\/ahmadawais\/AA-Basic-Shortcode-Plugin-Biolerplate\/tree\/master\/aa_basic_shortcodes\/shortcodes\">shortcodes<\/a>\u00a0this folder contains PHP modules of each shortcode being coded in our plugin<\/li>\n<\/ul>\n<p>Files<\/p>\n<ul>\n<li><a id=\"e7eaa048d9b98a3c63dbd996d325b08f-4f02b97ca2be064269902c6ec89c86a591402ba8\" class=\"js-directory-link\" title=\"aa_basic_shortcodes.php\" href=\"https:\/\/github.com\/ahmadawais\/AA-Basic-Shortcode-Plugin-Biolerplate\/blob\/master\/aa_basic_shortcodes\/aa_basic_shortcodes.php\">aa_basic_shortcodes.php<\/a>\u00a0Plugins base file<\/li>\n<li><a id=\"8066d68130ff5a535bfb08fc9bbf61f0-11aa3f7957a2cc5809438f261a7f022d397e229c\" class=\"js-directory-link\" title=\"aa_aboutme.php\" href=\"https:\/\/github.com\/ahmadawais\/AA-Basic-Shortcode-Plugin-Biolerplate\/blob\/master\/aa_basic_shortcodes\/shortcodes\/aa_aboutme.php\">aa_aboutme.php<\/a>\u00a0The [aa_me]\u00a0shortcode module\u00a0present in shortcodes folder<\/li>\n<li><a id=\"d250311388a32ad75e67fb8a59da717c-2fed076e934e909d1da71b375f90aa05da31843a\" class=\"js-directory-link\" title=\"aa_adsense.php\" href=\"https:\/\/github.com\/ahmadawais\/AA-Basic-Shortcode-Plugin-Biolerplate\/blob\/master\/aa_basic_shortcodes\/shortcodes\/aa_adsense.php\">aa_adsense.php<\/a>\u00a0The [adsense] shortcode module present in shortcodes folder<\/li>\n<li><a id=\"ccabef3057b42f287595e626237c8986-f844e4d18ee65393b39079c9aa3bad11a65e3348\" class=\"js-directory-link\" title=\"aa_login_users_only.php\" href=\"https:\/\/github.com\/ahmadawais\/AA-Basic-Shortcode-Plugin-Biolerplate\/blob\/master\/aa_basic_shortcodes\/shortcodes\/aa_login_users_only.php\">aa_login_users_only.php<\/a>\u00a0The\u00a0[member][\/member] shortcode module present in shortcodes folder<\/li>\n<\/ul>\n<p>There are empty index files, license files and some of the GitHub\/Git relevant files which you can ignore.<\/p>\n<\/div>\n<\/div>\n<section class=\"postcontents wrapper\">\n<h3 id=\"registering-the-plugin\">Registering the Plugin<a href=\"#registering-the-plugin\" class=\"heading-link\">#<\/a><\/h3>\n<p>First of all, for WordPress to recognize your plugin, you need to populate the header of your base plugin file with\u00a0few lines of\u00a0a PHP comment. Let&#8217;s see what are these lines<\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/ahmadawais\/db52b63f4e09637aaa3c.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/ahmadawais\/db52b63f4e09637aaa3c\">Gist<\/a>.<\/noscript><\/div>\n<h3 id=\"requiring-the-shortcode-modules\">Requiring\u00a0the Shortcode Modules<a href=\"#requiring-the-shortcode-modules\" class=\"heading-link\">#<\/a><\/h3>\n<p>Then I\u00a0added few lines of code to ensure no one calls this PHP file directly. Then comes the code where I required the shortcode modules in the shortcode folder.<\/p>\n<h2 id=\"shortcode-modules\">Shortcode Modules<a href=\"#shortcode-modules\" class=\"heading-link\">#<\/a><\/h2>\n<p>I have added three basic shortcode modules.<\/p>\n<ul>\n<li>Link shortcode [aa_me]<\/li>\n<li>Adsense ad shortcode [adsense]<\/li>\n<li>Members only shortcode [member][\/member]<\/li>\n<\/ul>\n<p>In each of these shortcode modules, we have shortcode functions and their registering actions. Pretty simple, but modular.<\/p>\n<h3 id=\"link-shortcode\">Link Shortcode<a href=\"#link-shortcode\" class=\"heading-link\">#<\/a><\/h3>\n<p>[aa_me]<\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/d9c50c43135b1ae61648.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/d9c50c43135b1ae61648\">Gist<\/a>.<\/noscript><\/div>\n<h3 id=\"adsense-ad-shortcode\">Adsense Ad Shortcode<a href=\"#adsense-ad-shortcode\" class=\"heading-link\">#<\/a><\/h3>\n<p>[adsense]<\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/ahmadawais\/83bea634bf8699bc9489.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/ahmadawais\/83bea634bf8699bc9489\">Gist<\/a>.<\/noscript><\/div>\n<h3 id=\"members-only-shortcode\">Members Only Shortcode<a href=\"#members-only-shortcode\" class=\"heading-link\">#<\/a><\/h3>\n<p>[member][\/member]<\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/ahmadawais\/8a629cf9571c10e8695d.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/ahmadawais\/8a629cf9571c10e8695d\">Gist<\/a>.<\/noscript><\/div>\n<p>I hope you people get the idea of how to organize and code a standard shortcode plugin in WordPress. In future, I&#8217;ll try to improve this boilerplate to OOP code\u00a0for industrial level shortcodes.<\/p>\n<h2 id=\"it-your-turn\">It Your Turn?<a href=\"#it-your-turn\" class=\"heading-link\">#<\/a><\/h2>\n<p>Did you enjoy the maintainable standard WordPress plugin code with documentation? If you have any questions, don&#8217;t hesitate to ask. Pull requests and issues are most welcomed at the GitHub&#8217;s repository.<\/p>\n<p><a href=\"https:\/\/github.com\/ahmadawais\/AA-Basic-Shortcode-Plugin-Biolerplate\" target=\"_blank\" class=\"shortbutton green large\">Fork at Github<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Shortcode API in WordPress is really cool. I already wrote about coding your very first shortcode in WordPress. Today&#8217;s discussion is about using your WordPress knowledge in the best possible way. Today I&#8217;ll be creating the same three shortcodes we created in the earlier article, but this time we\u00a0will be coding them through a WordPress plugin. Where to Code WordPress Shortcodes?# Enough talk!\u00a0There are two options\u00a0when it comes to coding shortcodes in WordPress Shortcodes in functions.php Shortcodes in a Custom plugin (Recommended) \u00a0Shortcodes in functions.php# In a WordPress install, there is a folder wp-content which contains both the plugins &amp; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":276,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[10],"tags":[63,62,64],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.4.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Coding a Basic Shortcodes WordPress Plugin Boilerplate<\/title>\n<meta name=\"description\" content=\"Learn how to code maintainable, standard, organised and modular WordPress Shortcode plugin from Ahmad Awais. WordPress Standard Documentation\" \/>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Coding a Basic Shortcodes WordPress Plugin Boilerplate\" \/>\n<meta property=\"og:description\" content=\"Learn how to code maintainable, standard, organised and modular WordPress Shortcode plugin from Ahmad Awais. WordPress Standard Documentation\" \/>\n<meta property=\"og:url\" content=\"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/\" \/>\n<meta property=\"og:site_name\" content=\"Ahmad Awais\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/AhmadAwais\" \/>\n<meta property=\"article:author\" content=\"https:\/\/facebook.com\/AhmadAwais\" \/>\n<meta property=\"article:published_time\" content=\"2014-10-13T20:08:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-06-28T05:22:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Basic-Shortcode-WordPress-Plugin-Boilerplate1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/MrAhmadAwais\" \/>\n<meta name=\"twitter:site\" content=\"@MrAhmadAwais\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ahmad Awais\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/#website\",\"url\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/\",\"name\":\"Ahmad Awais\",\"description\":\"Open Source Developer Advocate\",\"publisher\":{\"@id\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/#\/schema\/person\/1d1b9504182dca2315cf039fb4ebb85b\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Basic-Shortcode-WordPress-Plugin-Boilerplate1.png\",\"contentUrl\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Basic-Shortcode-WordPress-Plugin-Boilerplate1.png\",\"width\":800,\"height\":600},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#webpage\",\"url\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/\",\"name\":\"Coding a Basic Shortcodes WordPress Plugin Boilerplate\",\"isPartOf\":{\"@id\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#primaryimage\"},\"datePublished\":\"2014-10-13T20:08:57+00:00\",\"dateModified\":\"2016-06-28T05:22:03+00:00\",\"description\":\"Learn how to code maintainable, standard, organised and modular WordPress Shortcode plugin from Ahmad Awais. WordPress Standard Documentation\",\"breadcrumb\":{\"@id\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Coding a Basic Shortcodes WordPress Plugin Boilerplate\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#webpage\"},\"author\":{\"@id\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/#\/schema\/person\/1d1b9504182dca2315cf039fb4ebb85b\"},\"headline\":\"Coding a Basic Shortcodes WordPress Plugin Boilerplate\",\"datePublished\":\"2014-10-13T20:08:57+00:00\",\"dateModified\":\"2016-06-28T05:22:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#webpage\"},\"wordCount\":939,\"commentCount\":9,\"publisher\":{\"@id\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/#\/schema\/person\/1d1b9504182dca2315cf039fb4ebb85b\"},\"image\":{\"@id\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Basic-Shortcode-WordPress-Plugin-Boilerplate1.png\",\"keywords\":[\"boilerplate\",\"shortcode\",\"WordPress Plugin\"],\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#respond\"]}]},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/#\/schema\/person\/1d1b9504182dca2315cf039fb4ebb85b\",\"name\":\"Ahmad Awais\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2020\/06\/Ahmad-Awais-face.jpg\",\"contentUrl\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2020\/06\/Ahmad-Awais-face.jpg\",\"width\":2299,\"height\":1705,\"caption\":\"Ahmad Awais\"},\"logo\":{\"@id\":\"https:\/\/staging-ahmadawais.kinsta.cloud\/#personlogo\"},\"description\":\"Helping businesses understand developers. Head of Developer Relations RapidAPI. \ud83d\udcdf Edutainer at Node.js CLI Automation course (100 videos \u00b7 22 Projects) & VSCode.pro course (over 20K devs). \ud83c\udfa9 Award-winning Open Source Engineer & Dev Advocate \ud83e\udd8a Google Developers Expert Web DevRel \ud83d\ude80 Mars Ingenuity Helicopter code contributor \ud83c\udfc6 8th GitHub Stars Award recipient \ud83c\udf33 Node.js foundation Community Committee Outreach Lead, Member Linux Foundation, OpenAPI Business Governing Board, and DigitalOcean Navigator. \u270c\ufe0f Author of various open-source dev-tools and software libraries used by millions of developers worldwide \u24e6 WordPress Core Developer \ud83d\udce3 TEDx Speaker with 100+ international talks. \ud83d\udd25 Satya Nadella \u00b7 CEO of Microsoft, said \u2014 Awais is an awesome example for developers. \ud83d\ude4c Leading developers and publishing technical content for over a decade \ud83d\udc9c Loves his wife (Maedah) \u276f Read more about Ahmad Awais. \ud83d\udc4b\u2026 Awais is mostly active on Twitter @MrAhmadAwais\",\"sameAs\":[\"https:\/\/staging-ahmadawais.kinsta.cloud\",\"https:\/\/facebook.com\/AhmadAwais\",\"https:\/\/instagram.com\/MrAhmadAwais\/\",\"https:\/\/www.linkedin.com\/in\/MrAhmadAwais\/\",\"https:\/\/twitter.com\/https:\/\/twitter.com\/MrAhmadAwais\",\"https:\/\/youtube.com\/AhmadAwais\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Coding a Basic Shortcodes WordPress Plugin Boilerplate","description":"Learn how to code maintainable, standard, organised and modular WordPress Shortcode plugin from Ahmad Awais. WordPress Standard Documentation","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"Coding a Basic Shortcodes WordPress Plugin Boilerplate","og_description":"Learn how to code maintainable, standard, organised and modular WordPress Shortcode plugin from Ahmad Awais. WordPress Standard Documentation","og_url":"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/","og_site_name":"Ahmad Awais","article_publisher":"https:\/\/facebook.com\/AhmadAwais","article_author":"https:\/\/facebook.com\/AhmadAwais","article_published_time":"2014-10-13T20:08:57+00:00","article_modified_time":"2016-06-28T05:22:03+00:00","og_image":[{"width":800,"height":600,"url":"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Basic-Shortcode-WordPress-Plugin-Boilerplate1.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/MrAhmadAwais","twitter_site":"@MrAhmadAwais","twitter_misc":{"Written by":"Ahmad Awais","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/staging-ahmadawais.kinsta.cloud\/#website","url":"https:\/\/staging-ahmadawais.kinsta.cloud\/","name":"Ahmad Awais","description":"Open Source Developer Advocate","publisher":{"@id":"https:\/\/staging-ahmadawais.kinsta.cloud\/#\/schema\/person\/1d1b9504182dca2315cf039fb4ebb85b"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/staging-ahmadawais.kinsta.cloud\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#primaryimage","inLanguage":"en-US","url":"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Basic-Shortcode-WordPress-Plugin-Boilerplate1.png","contentUrl":"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Basic-Shortcode-WordPress-Plugin-Boilerplate1.png","width":800,"height":600},{"@type":"WebPage","@id":"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#webpage","url":"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/","name":"Coding a Basic Shortcodes WordPress Plugin Boilerplate","isPartOf":{"@id":"https:\/\/staging-ahmadawais.kinsta.cloud\/#website"},"primaryImageOfPage":{"@id":"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#primaryimage"},"datePublished":"2014-10-13T20:08:57+00:00","dateModified":"2016-06-28T05:22:03+00:00","description":"Learn how to code maintainable, standard, organised and modular WordPress Shortcode plugin from Ahmad Awais. WordPress Standard Documentation","breadcrumb":{"@id":"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/staging-ahmadawais.kinsta.cloud\/"},{"@type":"ListItem","position":2,"name":"Coding a Basic Shortcodes WordPress Plugin Boilerplate"}]},{"@type":"Article","@id":"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#article","isPartOf":{"@id":"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#webpage"},"author":{"@id":"https:\/\/staging-ahmadawais.kinsta.cloud\/#\/schema\/person\/1d1b9504182dca2315cf039fb4ebb85b"},"headline":"Coding a Basic Shortcodes WordPress Plugin Boilerplate","datePublished":"2014-10-13T20:08:57+00:00","dateModified":"2016-06-28T05:22:03+00:00","mainEntityOfPage":{"@id":"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#webpage"},"wordCount":939,"commentCount":9,"publisher":{"@id":"https:\/\/staging-ahmadawais.kinsta.cloud\/#\/schema\/person\/1d1b9504182dca2315cf039fb4ebb85b"},"image":{"@id":"https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#primaryimage"},"thumbnailUrl":"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Basic-Shortcode-WordPress-Plugin-Boilerplate1.png","keywords":["boilerplate","shortcode","WordPress Plugin"],"articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/staging-ahmadawais.kinsta.cloud\/coding-a-basic-shortcodes-plugin-boilerplate\/#respond"]}]},{"@type":["Person","Organization"],"@id":"https:\/\/staging-ahmadawais.kinsta.cloud\/#\/schema\/person\/1d1b9504182dca2315cf039fb4ebb85b","name":"Ahmad Awais","image":{"@type":"ImageObject","@id":"https:\/\/staging-ahmadawais.kinsta.cloud\/#personlogo","inLanguage":"en-US","url":"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2020\/06\/Ahmad-Awais-face.jpg","contentUrl":"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2020\/06\/Ahmad-Awais-face.jpg","width":2299,"height":1705,"caption":"Ahmad Awais"},"logo":{"@id":"https:\/\/staging-ahmadawais.kinsta.cloud\/#personlogo"},"description":"Helping businesses understand developers. Head of Developer Relations RapidAPI. \ud83d\udcdf Edutainer at Node.js CLI Automation course (100 videos \u00b7 22 Projects) & VSCode.pro course (over 20K devs). \ud83c\udfa9 Award-winning Open Source Engineer & Dev Advocate \ud83e\udd8a Google Developers Expert Web DevRel \ud83d\ude80 Mars Ingenuity Helicopter code contributor \ud83c\udfc6 8th GitHub Stars Award recipient \ud83c\udf33 Node.js foundation Community Committee Outreach Lead, Member Linux Foundation, OpenAPI Business Governing Board, and DigitalOcean Navigator. \u270c\ufe0f Author of various open-source dev-tools and software libraries used by millions of developers worldwide \u24e6 WordPress Core Developer \ud83d\udce3 TEDx Speaker with 100+ international talks. \ud83d\udd25 Satya Nadella \u00b7 CEO of Microsoft, said \u2014 Awais is an awesome example for developers. \ud83d\ude4c Leading developers and publishing technical content for over a decade \ud83d\udc9c Loves his wife (Maedah) \u276f Read more about Ahmad Awais. \ud83d\udc4b\u2026 Awais is mostly active on Twitter @MrAhmadAwais","sameAs":["https:\/\/staging-ahmadawais.kinsta.cloud","https:\/\/facebook.com\/AhmadAwais","https:\/\/instagram.com\/MrAhmadAwais\/","https:\/\/www.linkedin.com\/in\/MrAhmadAwais\/","https:\/\/twitter.com\/https:\/\/twitter.com\/MrAhmadAwais","https:\/\/youtube.com\/AhmadAwais"]}]}},"jetpack_featured_media_url":"https:\/\/staging-ahmadawais.kinsta.cloud\/wp-content\/uploads\/2014\/10\/Basic-Shortcode-WordPress-Plugin-Boilerplate1.png","_links":{"self":[{"href":"https:\/\/staging-ahmadawais.kinsta.cloud\/api\/wp\/v2\/posts\/263"}],"collection":[{"href":"https:\/\/staging-ahmadawais.kinsta.cloud\/api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staging-ahmadawais.kinsta.cloud\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staging-ahmadawais.kinsta.cloud\/api\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/staging-ahmadawais.kinsta.cloud\/api\/wp\/v2\/comments?post=263"}],"version-history":[{"count":0,"href":"https:\/\/staging-ahmadawais.kinsta.cloud\/api\/wp\/v2\/posts\/263\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/staging-ahmadawais.kinsta.cloud\/api\/wp\/v2\/media\/276"}],"wp:attachment":[{"href":"https:\/\/staging-ahmadawais.kinsta.cloud\/api\/wp\/v2\/media?parent=263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staging-ahmadawais.kinsta.cloud\/api\/wp\/v2\/categories?post=263"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staging-ahmadawais.kinsta.cloud\/api\/wp\/v2\/tags?post=263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}