{"id":9592,"date":"2020-07-04T18:40:41","date_gmt":"2020-07-04T10:40:41","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=9592"},"modified":"2022-10-18T20:11:56","modified_gmt":"2022-10-18T12:11:56","slug":"beginners-guide-to-wordpress-plugin-development","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/beginners-guide-to-wordpress-plugin-development\/","title":{"rendered":"Beginner&#8217;s Guide to WordPress Plugin Development"},"content":{"rendered":"<p>The WordPress CMS has changed the face of our Internet and allowed a surge of new ideas to prosper, and its open-source movement holds a strong presence rooted in software and web development.<\/p>\n<p>WordPress is a blogging platform that has the ability to launch into many other scripts such as web forums, job boards, and even a classic webpage Content Management System.<\/p>\n<p>We\u2019ll be going over a few ways to get started in plug-ins development for WordPress. The steps are relatively simple and don\u2019t require immense dedication to study. A rudimentary <a target=\"_blank\" href=\"https:\/\/www.php.net\/manual\/en\/tutorial.firstpage.php\" rel=\"noopener noreferrer\">knowledge of PHP<\/a> would be useful even with a basic understanding of the <a target=\"_blank\" href=\"https:\/\/codex.wordpress.org\/Site_Architecture_1.5\" rel=\"noopener noreferrer\">WordPress file structure<\/a> and <a target=\"_blank\" href=\"https:\/\/codex.wordpress.org\/Administration_Panels\" rel=\"noopener noreferrer\">Administration panel<\/a>.<\/p>\n<p>In this brief tutorial, we\u2019ll be going over the necessary steps required to create a simple WordPress plug-in. The functionality will be used to develop dynamic excerpts based on the number passed into our function call.<\/p>\n<p>You\u2019ll need to upload the plug-in file and activate it from the Admin panel, then follow up by calling our function from whatever pages we want the excerpt to appear. Links to completed plug-in source code is already added later in this article :)<\/p>\n<div class=\"ref-block ref-block--post\" id=\"ref-post-1\">\n\t\t\t\t\t<a href=\"https:\/\/www.hongkiat.com\/blog\/40-most-wanted-wordpress-tricks-and-hacks\/\" class=\"ref-block__link\" title=\"Read More: 60+ Most Wanted WordPress Tricks and Hacks (Updated)\" rel=\"bookmark\"><span class=\"screen-reader-text\">60+ Most Wanted WordPress Tricks and Hacks (Updated)<\/span><\/a>\n<div class=\"ref-block__thumbnail img-thumb img-thumb--jumbo\" data-img='{ \"src\" : \"https:\/\/assets.hongkiat.com\/uploads\/thumbs\/250x160\/40-most-wanted-wordpress-tricks-and-hacks.jpg\" }'>\n\t\t\t\t\t\t\t<noscript>\n<style>.no-js #ref-block-post-1474 .ref-block__thumbnail { background-image: url(\"https:\/\/assets.hongkiat.com\/uploads\/thumbs\/250x160\/40-most-wanted-wordpress-tricks-and-hacks.jpg\"); }<\/style>\n<\/noscript>\n\t\t\t\t\t\t<\/div>\n<div class=\"ref-block__summary\">\n<h4 class=\"ref-title\">60+ Most Wanted WordPress Tricks and Hacks (Updated)<\/h4>\n<p class=\"ref-description\">\n\t\t\t\t\t\tHave you ever came across a WordPress blog, saw something you liked, and thought; how they did that,...\t\t\t\t\t\t<span>Read more<\/span><\/p>\n<\/div>\n<\/div>\n<h2>Why develop for WordPress?<\/h2>\n<p>Plug-ins are a great way to enhance the functionality of your blog by adding extra features. These can be placed anywhere inside your template by function hooks.<\/p>\n<p>Over time the extensibility of WordPress\u2019 plug-in system has allowed tremendous growth and hundreds of developer-submitted pieces of software.\n  WordPress offers explicitly such advanced features in its CMS that unique plug-ins are few and far between.<\/p>\n<p>As a developer, you hold complete control over the backend specifics of your weblog. Hiring a PHP developer to create a system plugin would cost a lot more than you may imagine, and the API is relatively easy enough to work with and learn yourself.<\/p>\n<p>As a secondary argument, developing over WordPress is an excellent practice for tuning yourself into other areas. Building smaller plugins and sidebar widgets in WordPress will help you develop an understanding of how the backend system works.<\/p>\n<p>This isn\u2019t just limited to WordPress, as you\u2019ll gain a deeper understanding of the vast majority of Content Systems.<\/p>\n<h2>1. WP folder structure<\/h2>\n<p>An introduction to the WordPress folder structure will show the primary app directories. Inside wp-content, you\u2019ll find a <strong>plugins<\/strong> directory. Here is where all of your individual plug-ins will be housed, either single files or properly named sub-directories.<\/p>\n<p>For smaller plug-ins which only require a single .php file, you have the option to place this directly into the plug-ins\/ directory. However, when you start developing more complicated applications, it\u2019s much more useful to create a subdirectory named after your plug-in.<\/p>\n<p>Inside, you can house JavaScript, CSS, and HTML includes along with your PHP functions.<\/p>\n<p>A <code>readme.txt<\/code> file can also be useful if you\u2019re planning on offering your plugin for download. This file should include your name and what the plugin does. As the author, you may also consider including details about each revision and which updates have come out.<\/p>\n<h2>2. Starting your PHP file<\/h2>\n<p>When creating a new plugin, you\u2019ll need to start with a simple PHP file. This can be named anything but should generally reflect your plug-in\u2019s official name.<\/p>\n<p>So for example I have created our base code and have named my file <a target=\"_blank\" href=\"https:\/\/assets.hongkiat.com\/uploads\/develop-wordpress-plugin\/hongkiat-excerpt.phps\" rel=\"noopener noreferrer\">hongkiat-excerpt.phps<\/a> (save and rename the file to .php).<\/p>\n<p>The first lines of your plug-in <strong>must<\/strong> be comment information for the parsing engine.<\/p>\n<p>This is extremely important as WordPress will be unable to process your file without. Below is an example code snippet you can copy and mold towards your own.<\/p>\n<pre>&lt;?php\r\n\/*\r\nPlugin Name: Plugin Name here\r\nPlugin URI: http:\/\/www.yourpluginurlhere.com\/\r\nVersion: Current Version\r\nAuthor: Name please\r\nDescription: What does your plugin do and what features does it offer...\r\n*\/\r\n<\/pre>\n<p>The Plugin Name is what will show up in your Admin backend panel when you go to activate. Same with the URI, which will be placed in the details pane inside the plug-ins panel.<\/p>\n<p>Although it\u2019s not required to include a version or description, it does make your plugin look much more professional.<\/p>\n<h2>3. WordPress naming conventions and best practices<\/h2>\n<p>There are a few ways to actually structure your plug-in.<\/p>\n<p>Many times PHP developers will create an entire class system in order to avoid collisions with functions and variable names. If you are unfamiliar with the advanced OOP functionality of PHP, then it\u2019s best to just write your code in sample functions.<\/p>\n<p>So for our example code, we will write a single function to house our data. We also need to define a few variables which are crucial to implement inside our template files.<\/p>\n<p>Below is an example bit of code taken from our plugin file with the core logic removed.<\/p>\n<p>When writing your sample code, it\u2019s best to follow regulations and guides set up by WordPress. Since there are so many internal functions already defined, you can avoid duplicates by prefixing a label to all your variables and function names.<\/p>\n<pre>&lt;?php\r\ndefine(\"HK_EXAMPLE_CONSTANT\", \"this is a value\");\r\nfunction hk_example_function( $limit ) {\r\n  \/\/ Some code goes here.\r\n}\r\n\r\n?&gt;\r\n<\/pre>\n<p>In the above example, we prefixed all our setting names with <em>hongkiat<\/em>.<\/p>\n<p>This can be replaced with any keyword of your choosing usually related to your plugin name. The above code is just <strong>sample settings<\/strong> and shouldn\u2019t pertain to our final plug-in.<\/p>\n<p>This is just to give you some insight into how your variable names and function calls should be written.<\/p>\n<h2>4. Diving into Filters and Actions<\/h2>\n<p>There is another concept noteworthy of mentioning before we jump into our raw code.<\/p>\n<p><strong>Actions<\/strong> and <strong>filters<\/strong> are two completely different concepts that relate genuinely to the ways they manipulate plugin data.<\/p>\n<p>These two bits of code come standard within the WordPress API. Filters and actions allow for plug-in developers to update bits of code throughout the WordPress admin panel pertaining to your new plug-in.<\/p>\n<p>This means you could add a new tab in the sidebar or additional settings links for your Plug-in options.<\/p>\n<figure> <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/develop-wordpress-plugin\/php-codelobster-ide.jpg\" alt=\"CodeLobster PHP IDE\" width=\"550\" height=\"250\"><\/figure>\n<h3>Understanding add_filter()<\/h3>\n<p>A <strong>filter<\/strong> is used on a bit of text or data being passed into WordPress. With filters you are quite literally able to <em>filter content<\/em> through your own custom written functions to change data in any way.<\/p>\n<p>For example, you may create a filter to change <code>$the_content<\/code> which is a variable set by WordPress containing the entire post content of a WordPress article.<\/p>\n<p>For our plug-in we will be taking <code>$the_content<\/code> and shortening the length of characters into an excerpt.<\/p>\n<p>Filters come in handy when you are writing plug-ins to customize the looks and feel of your blog. These are especially popular when writing sidebar widgets or smaller functions to change how a post should be displayed.<\/p>\n<p>Below is a sample line of code showing how to apply a filter.<\/p>\n<pre>add_filter('wp_title', 'hongkiat_func');<\/pre>\n<p>Here we are adding a filter into the WordPress page title. Note this code doesn\u2019t relate to our official plugin and is only being used as an example here.<\/p>\n<p>The <code>add_filter<\/code> function is native to WordPress and used to add a new filter to a variable found within page content.<\/p>\n<p>In the line above we\u2019re targeting <code>$wp_title<\/code> which contains the title of our current page.<\/p>\n<p>We are then passing this variable into a fake function titled <code>hongkiat_func()<\/code> which could then manipulate and return a new title tag for whatever purposes.<\/p>\n<h3>Understanding add_action()<\/h3>\n<p>Actions are similar to filters in that they don\u2019t work on bits of data but instead target pre-defined areas in your templates and admin panel. As an example you can apply an action whenever you update or edit a page\u2019s content.<\/p>\n<p>WordPress offers a <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/developer.wordpress.org\/reference\/hooks\/\">comprehensive actions list<\/a> in their API documentation. Below is a small list of example actions for you to get familiar with some of the pre-defined target areas.<\/p>\n<ul>\n<li><strong>publish_post<\/strong> \u2013 called when a post is published or when status is changed into \u201cpublished\u201d<\/li>\n<li><strong>save_post<\/strong> \u2013 called when a post\/page is created from start or updated<\/li>\n<li><strong>wp_head<\/strong> \u2013 called when the template is loaded and runs the <code>wp_head()<\/code> function<\/li>\n<li><strong>loop_end<\/strong> \u2013 called immediately after the final post has been processed through the WordPress loop<\/li>\n<li><strong>trackback_post<\/strong> \u2013 called whenever a new trackback is added into a post<\/li>\n<\/ul>\n<p>Again we can see how simple this bit of code boils down to. If you can understand the difference between actions and filters you\u2019ll be that much closer to building comprehensive, working WordPress plugins.<\/p>\n<p>Below is another line of code initializing an action function on the <code>save_post<\/code> hook. To clarify again this doesn\u2019t pertain to our current developing plugin and is only used as a piece of example code to understand the <code>add_action()<\/code> function.<\/p>\n<pre>add_action('save_post', 'notify');<\/pre>\n<p>So here we see a similar setup to before with <code>add_filter()<\/code>. We need 2 variables, the first holds the name of our hook we\u2019re targeting.<\/p>\n<p>In this case <code>save_post<\/code> which means whenever a new post is saved we\u2019re going to call our function defined in the second position (<code>notify()<\/code>). You could obviously update notify to be whatever function name you\u2019d want to run, however this isn\u2019t required for our current example plug-in.<\/p>\n<h2>Finishing our plugin logic<\/h2>\n<p>Finishing up on our path we\u2019ll be adding our final function right into our plug-in file. The API documentation is very specific and provides an excellent resource to developers who may hold advanced questions.<\/p>\n<p>The material may seem difficult if you are not familiar with PHP but take your time with the concepts and things will start to flow naturally!<\/p>\n<p>The function below should be added directly after your plugin\u2019s header comment. Alternatively this could also be placed inside your theme\u2019s <code>functions.php<\/code> file.<\/p>\n<p>The code is used to create dynamic post content based on a limited range of characters.<\/p>\n<p>So for our example we can limit story excerpts only 55 characters long with the <code>hk_trim_content()<\/code> function. You could easly call this bit of code from a sidebar widget or one of your theme files to replace <code>$the_content<\/code>.<\/p>\n<pre>&lt;?php \r\nfunction hk_trim_content( $limit ) {\r\n  $content = explode( ' ', get_the_content(), $limit );\r\n  \r\n  if ( count( $content ) &gt;= $limit ) {\r\n    array_pop( $content );\r\n    $content = implode(\" \",$content).'...';\r\n  } else {\r\n    $content = implode(\" \",$content);\r\n  }\t\r\n  \r\n  $content = preg_replace('\/\\[.+\\]\/','', $content);\r\n  $content = apply_filters('the_content', $content); \r\n\r\n  return $content;\r\n}\r\n?&gt;\r\n<\/pre>\n<p>It shouldn\u2019t be expected that you fully understand all internal variables or functions used here. Just getting a general understanding of how your functions should be written and what an example set would look like is a very good start.<\/p>\n<p>You may also notice we\u2019re using a call to <code>apply_filters<\/code> which is another WordPress-specific function.<\/p>\n<p>This is another aspect you don\u2019t need to fully grasp but it does help with future programming over WP. Check out the <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/developer.wordpress.org\/reference\/functions\/apply_filters\/\">apply_filters reference page<\/a> for more details and FAQs on the subject.<\/p>\n<p>The core function above is named <code>hk_trim_content()<\/code>. This only requires 1 parameter named <code>$limit<\/code>.<\/p>\n<p>This could also be shortened to <code>$lim<\/code> which should store an integer specifying how many characters to limit your excerpt to. The content is used on full post pages and also static pages (about us, contact).<\/p>\n<p>Therefore, in order to call this function we would need to add the parameter into our template files. This would be placed somewhere possibly in your <code>index.php<\/code> or <code>loop.php<\/code> file(s) and will require you to install the plugin first. Example below:<\/p>\n<pre>&lt;?php echo hk_trim_content(55); \/\/ display page content limited at 55 chars ?&gt;<\/pre>\n<h2>Installing and running the plugin<\/h2>\n<p>I\u2019ve created a sample file for the plugin to demo if you\u2019d like to skip the hard coding.<\/p>\n<p>Simply download <a target=\"_blank\" href=\"https:\/\/assets.hongkiat.com\/uploads\/develop-wordpress-plugin\/hongkiat-excerpt.phps\" rel=\"noopener noreferrer\">this file<\/a> (save and rename the file to <code>.php<\/code>) or copy\/paste the code into a new PHP document and upload this to your <code>\/wp-content\/plugins<\/code> directory.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/develop-wordpress-plugin\/hk-demo-plugin.jpg\" alt=\"HK Demo Plugin Installed\" width=\"550\" height=\"250\"><\/figure>\n<p>Once completed you\u2019ll want to access the WordPress administration panel and browse your current set of plug-ins for the demo just installed. Once you activate nothing new will happen, not until we manually add in our function call.<\/p>\n<p>To do this simply navigate <code>Appearance -&gt; Editor<\/code> and look for <strong><code>single.php<\/code><\/strong>.<\/p>\n<p>This file contains all the template HTML\/CSS for your basic article post page. Scroll down until you find <code>the_content()<\/code> and replace with the example code above. This will limit all your article pages to 55 characters no matter what view is being used.<\/p>\n<p>You could also add in this function to similar pages in your templates directory such as <code>search.php<\/code> or <code>archive.php<\/code>.<\/p>\n<h2>Conclusion<\/h2>\n<p>These are some of the basics to get you started working within WordPress development. The plugin system is vast and contains a great deal of internal functionality.<\/p>\n<p>If you already have an idea for a plug-in try it out on a local installation of WordPress to practice these topics.<\/p>\n<p>If you\u2019re still confused by much of the information you can review the <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/developer.wordpress.org\/reference\/\">WordPress documentation<\/a> and search for your answer there.<\/p>\n<p>The development community is full of helpful users and the forums hold archives with questions from years back.<\/p>","protected":false},"excerpt":{"rendered":"<p>The WordPress CMS has changed the face of our Internet and allowed a surge of new ideas to prosper, and its open-source movement holds a strong presence rooted in software and web development. WordPress is a blogging platform that has the ability to launch into many other scripts such as web forums, job boards, and&hellip;<\/p>\n","protected":false},"author":18,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[49],"tags":[4663,255],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Beginner&#039;s Guide to WordPress Plugin Development - Hongkiat<\/title>\n<meta name=\"description\" content=\"The WordPress CMS has changed the face of our Internet and allowed a surge of new ideas to prosper, and its open-source movement holds a strong presence\" \/>\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.hongkiat.com\/blog\/beginners-guide-to-wordpress-plugin-development\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Beginner&#039;s Guide to WordPress Plugin Development\" \/>\n<meta property=\"og:description\" content=\"The WordPress CMS has changed the face of our Internet and allowed a surge of new ideas to prosper, and its open-source movement holds a strong presence\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/beginners-guide-to-wordpress-plugin-development\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-04T10:40:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-10-18T12:11:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/develop-wordpress-plugin\/php-codelobster-ide.jpg\" \/>\n<meta name=\"author\" content=\"Jake Rocheleau\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jake Rocheleau\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/beginners-guide-to-wordpress-plugin-development\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/beginners-guide-to-wordpress-plugin-development\\\/\"},\"author\":{\"name\":\"Jake Rocheleau\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/966b2daea15283b4145e71aa98a82c2a\"},\"headline\":\"Beginner&#8217;s Guide to WordPress Plugin Development\",\"datePublished\":\"2020-07-04T10:40:41+00:00\",\"dateModified\":\"2022-10-18T12:11:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/beginners-guide-to-wordpress-plugin-development\\\/\"},\"wordCount\":2049,\"commentCount\":64,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/beginners-guide-to-wordpress-plugin-development\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/develop-wordpress-plugin\\\/php-codelobster-ide.jpg\",\"keywords\":[\"ad-divi\",\"plugins\"],\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/beginners-guide-to-wordpress-plugin-development\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/beginners-guide-to-wordpress-plugin-development\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/beginners-guide-to-wordpress-plugin-development\\\/\",\"name\":\"Beginner's Guide to WordPress Plugin Development - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/beginners-guide-to-wordpress-plugin-development\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/beginners-guide-to-wordpress-plugin-development\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/develop-wordpress-plugin\\\/php-codelobster-ide.jpg\",\"datePublished\":\"2020-07-04T10:40:41+00:00\",\"dateModified\":\"2022-10-18T12:11:56+00:00\",\"description\":\"The WordPress CMS has changed the face of our Internet and allowed a surge of new ideas to prosper, and its open-source movement holds a strong presence\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/beginners-guide-to-wordpress-plugin-development\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/beginners-guide-to-wordpress-plugin-development\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/beginners-guide-to-wordpress-plugin-development\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/develop-wordpress-plugin\\\/php-codelobster-ide.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/develop-wordpress-plugin\\\/php-codelobster-ide.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/beginners-guide-to-wordpress-plugin-development\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Beginner&#8217;s Guide to WordPress Plugin Development\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/966b2daea15283b4145e71aa98a82c2a\",\"name\":\"Jake Rocheleau\",\"description\":\"Jake is a writer and designer with over 10 years experience working on the web. He writes about user experience design and cool resources for designers\",\"sameAs\":[\"https:\\\/\\\/www.hongkiat.com\"],\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/jake\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Beginner's Guide to WordPress Plugin Development - Hongkiat","description":"The WordPress CMS has changed the face of our Internet and allowed a surge of new ideas to prosper, and its open-source movement holds a strong presence","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.hongkiat.com\/blog\/beginners-guide-to-wordpress-plugin-development\/","og_locale":"en_US","og_type":"article","og_title":"Beginner's Guide to WordPress Plugin Development","og_description":"The WordPress CMS has changed the face of our Internet and allowed a surge of new ideas to prosper, and its open-source movement holds a strong presence","og_url":"https:\/\/www.hongkiat.com\/blog\/beginners-guide-to-wordpress-plugin-development\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2020-07-04T10:40:41+00:00","article_modified_time":"2022-10-18T12:11:56+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/develop-wordpress-plugin\/php-codelobster-ide.jpg","type":"","width":"","height":""}],"author":"Jake Rocheleau","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Jake Rocheleau","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/beginners-guide-to-wordpress-plugin-development\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/beginners-guide-to-wordpress-plugin-development\/"},"author":{"name":"Jake Rocheleau","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/966b2daea15283b4145e71aa98a82c2a"},"headline":"Beginner&#8217;s Guide to WordPress Plugin Development","datePublished":"2020-07-04T10:40:41+00:00","dateModified":"2022-10-18T12:11:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/beginners-guide-to-wordpress-plugin-development\/"},"wordCount":2049,"commentCount":64,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/beginners-guide-to-wordpress-plugin-development\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/develop-wordpress-plugin\/php-codelobster-ide.jpg","keywords":["ad-divi","plugins"],"articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/beginners-guide-to-wordpress-plugin-development\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/beginners-guide-to-wordpress-plugin-development\/","url":"https:\/\/www.hongkiat.com\/blog\/beginners-guide-to-wordpress-plugin-development\/","name":"Beginner's Guide to WordPress Plugin Development - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/beginners-guide-to-wordpress-plugin-development\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/beginners-guide-to-wordpress-plugin-development\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/develop-wordpress-plugin\/php-codelobster-ide.jpg","datePublished":"2020-07-04T10:40:41+00:00","dateModified":"2022-10-18T12:11:56+00:00","description":"The WordPress CMS has changed the face of our Internet and allowed a surge of new ideas to prosper, and its open-source movement holds a strong presence","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/beginners-guide-to-wordpress-plugin-development\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/beginners-guide-to-wordpress-plugin-development\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/beginners-guide-to-wordpress-plugin-development\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/develop-wordpress-plugin\/php-codelobster-ide.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/develop-wordpress-plugin\/php-codelobster-ide.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/beginners-guide-to-wordpress-plugin-development\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Beginner&#8217;s Guide to WordPress Plugin Development"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/966b2daea15283b4145e71aa98a82c2a","name":"Jake Rocheleau","description":"Jake is a writer and designer with over 10 years experience working on the web. He writes about user experience design and cool resources for designers","sameAs":["https:\/\/www.hongkiat.com"],"url":"https:\/\/www.hongkiat.com\/blog\/author\/jake\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-2uI","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/9592","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=9592"}],"version-history":[{"count":4,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/9592\/revisions"}],"predecessor-version":[{"id":51868,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/9592\/revisions\/51868"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=9592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=9592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=9592"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=9592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}