{"id":23,"date":"2017-07-07T12:14:07","date_gmt":"2017-07-07T10:14:07","guid":{"rendered":"http:\/\/numa-bord.com\/miniblog\/?p=23"},"modified":"2017-07-10T12:48:29","modified_gmt":"2017-07-10T10:48:29","slug":"wordpress-creation-dun-plugin-permettant-dajouter-shortcode","status":"publish","type":"post","link":"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/","title":{"rendered":"WordPress : Cr\u00e9ation d&rsquo;un plugin permettant d&rsquo;ajouter un shortcode"},"content":{"rendered":"<p>Voici ci-dessous le code tr\u00e8s simple d&rsquo;un plugin wordpress.<br \/>Celui-ci permet d&rsquo;utiliser un nouveau shortcode dans le syst\u00e8me wordpress.<br \/>Dans le cas pr\u00e9sent il va simplement afficher la liste des xx derniers utilisateurs inscrit sur le site.\n<\/p>\n<p>\nPour l&rsquo;exemple le plugin s&rsquo;appelle \u00ab\u00a0Mon shortcode\u00a0\u00bb. Il suffit de cr\u00e9er le fichier php \u00ab\u00a0mon-shortcode.php\u00a0\u00bb avec le code ci dessous. <br \/>La pratique veut que l&rsquo;on place ce fichier dans un dossier du m\u00eame nom \u00ab\u00a0mon-shortcode\u00a0\u00bb, dossier \u00e0 placer bien entendu dans le dossier des plugins de wordpress.<br \/>La derni\u00e8re fonction pr\u00e9sent\u00e9 permet d&rsquo;ajouter une fichier de mise en page et de traitement javascript. Il faut bien sur les ajouter dans ce m\u00eame dossier pour qu&rsquo;il soient correctement appel\u00e9s.\n<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\"><span class=\"coMULTI\">\/*<br \/>\n&nbsp; Plugin Name: Mon shortcode<br \/>\n&nbsp; Description: Shortcode permettant d'afficher les derniers utilisateurs inscrits. Shortcode \u00e0 utiliser sur une page : [mon-shortcode nbusers=&quot;xx&quot;]<br \/>\n&nbsp; Version: 0.1<br \/>\n&nbsp; Author: Numa BORD<br \/>\n&nbsp;*\/<\/span><br \/>\n<br \/>\n<span class=\"kw2\">class<\/span> MonShortcode <span class=\"br0\">&#123;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> __construct<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span> <br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; add_shortcode<span class=\"br0\">&#40;<\/span><span class=\"st_h\">'mon-shortcode'<\/span><span class=\"sy0\">,<\/span> <a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"re0\">$this<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'shortcode_mon_shortcode'<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; add_action<span class=\"br0\">&#40;<\/span><span class=\"st_h\">'wp_enqueue_scripts'<\/span><span class=\"sy0\">,<\/span> <a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"re0\">$this<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'mon_shortcode_scripts'<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; <span class=\"co4\">\/**<br \/>\n&nbsp; &nbsp; &nbsp;* Fonction de traitement du shortcode, \u00e0 utiliser comme ci-dessous<br \/>\n&nbsp; &nbsp; &nbsp;*<br \/>\n&nbsp; &nbsp; &nbsp;* [mon-shortcode nbusers=&quot;xx&quot;]<br \/>\n&nbsp; &nbsp; &nbsp;*\/<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> shortcode_mon_shortcode<span class=\"br0\">&#40;<\/span><span class=\"re0\">$atts<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/init<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$default<\/span> <span class=\"sy0\">=<\/span> <a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$default<\/span><span class=\"br0\">&#91;<\/span><span class=\"st_h\">'nbusers'<\/span><span class=\"br0\">&#93;<\/span> <span class=\"sy0\">=<\/span> <span class=\"nu0\">10<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/controle des parametres pass\u00e9 dans le shortcode<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">if<\/span> <span class=\"br0\">&#40;<\/span><a href=\"http:\/\/www.php.net\/isset\"><span class=\"kw3\">isset<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"re0\">$atts<\/span><span class=\"br0\">&#91;<\/span><span class=\"st_h\">'nbusers'<\/span><span class=\"br0\">&#93;<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$atts<\/span><span class=\"br0\">&#91;<\/span><span class=\"st_h\">'nbusers'<\/span><span class=\"br0\">&#93;<\/span> <span class=\"sy0\">=<\/span> <span class=\"br0\">&#40;<\/span>int<span class=\"br0\">&#41;<\/span> <span class=\"re0\">$atts<\/span><span class=\"br0\">&#91;<\/span><span class=\"st_h\">'nbusers'<\/span><span class=\"br0\">&#93;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/configuration definis par les parametre par defaut et ceux pass\u00e9 dans le shortcode<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$config<\/span> <span class=\"sy0\">=<\/span> shortcode_atts<span class=\"br0\">&#40;<\/span><span class=\"re0\">$default<\/span><span class=\"sy0\">,<\/span> <span class=\"re0\">$atts<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$list<\/span> <span class=\"sy0\">=<\/span> <span class=\"st_h\">'&lt;div class=&quot;mon-shortcode&quot;&gt;'<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$users<\/span> <span class=\"sy0\">=<\/span> get_users<span class=\"br0\">&#40;<\/span><a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'number'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"re0\">$config<\/span><span class=\"br0\">&#91;<\/span><span class=\"st_h\">'nbusers'<\/span><span class=\"br0\">&#93;<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'orderby'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'registered'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'order'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'DESC'<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">foreach<\/span> <span class=\"br0\">&#40;<\/span><span class=\"re0\">$users<\/span> <span class=\"kw1\">as<\/span> <span class=\"re0\">$user<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$list<\/span> <span class=\"sy0\">.=<\/span> <span class=\"st_h\">'&lt;div class=&quot;single-user&quot;&gt;'<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/avatar<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$list<\/span> <span class=\"sy0\">.=<\/span> <span class=\"st_h\">'&lt;div class=&quot;avatar-glob&quot;&gt;'<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$list<\/span> <span class=\"sy0\">.=<\/span> get_avatar<span class=\"br0\">&#40;<\/span><span class=\"re0\">$user<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">user_email<\/span><span class=\"sy0\">,<\/span> <span class=\"nu0\">60<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$list<\/span> <span class=\"sy0\">.=<\/span> <span class=\"st_h\">'&lt;\/div&gt;'<\/span><span class=\"sy0\">;<\/span> <span class=\"co1\">\/\/avatar-glob<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$list<\/span> <span class=\"sy0\">.=<\/span> <span class=\"st_h\">'&lt;div class=&quot;info-glob&quot;&gt;'<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/pseudo<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$list<\/span> <span class=\"sy0\">.=<\/span> <span class=\"st_h\">'&lt;div class=&quot;title&quot;&gt;'<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$list<\/span> <span class=\"sy0\">.=<\/span> <span class=\"re0\">$user<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">display_name<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$list<\/span> <span class=\"sy0\">.=<\/span> <span class=\"st_h\">'&lt;\/div&gt;'<\/span><span class=\"sy0\">;<\/span> <span class=\"co1\">\/\/title<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/date d'inscription<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$list<\/span> <span class=\"sy0\">.=<\/span> <span class=\"st_h\">'&lt;div class=&quot;date&quot;&gt;'<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$registrered<\/span> <span class=\"sy0\">=<\/span> <span class=\"kw2\">new<\/span> \\DateTime<span class=\"br0\">&#40;<\/span><span class=\"re0\">$user<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">user_registered<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$list<\/span> <span class=\"sy0\">.=<\/span> <span class=\"re0\">$registrered<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">format<\/span><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'d\/m\/Y H:i:s'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$list<\/span> <span class=\"sy0\">.=<\/span> <span class=\"st_h\">'&lt;\/div&gt;'<\/span><span class=\"sy0\">;<\/span> <span class=\"co1\">\/\/date<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$list<\/span> <span class=\"sy0\">.=<\/span> <span class=\"st_h\">'&lt;\/div&gt;'<\/span><span class=\"sy0\">;<\/span> <span class=\"co1\">\/\/info glob<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$list<\/span> <span class=\"sy0\">.=<\/span> <span class=\"st_h\">'&lt;\/div&gt;'<\/span><span class=\"sy0\">;<\/span> <span class=\"co1\">\/\/single user<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$list<\/span> <span class=\"sy0\">.=<\/span> <span class=\"st_h\">'&lt;\/div&gt;'<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">return<\/span> <span class=\"re0\">$list<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; <span class=\"co4\">\/**<br \/>\n&nbsp; &nbsp; &nbsp;* Appel des fichiers js\/css necessaires (facultatif)<br \/>\n&nbsp; &nbsp; &nbsp;*\/<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> mon_shortcode_scripts<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw2\">global<\/span> <span class=\"re0\">$post<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">if<\/span> <span class=\"br0\">&#40;<\/span><a href=\"http:\/\/www.php.net\/is_a\"><span class=\"kw3\">is_a<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"re0\">$post<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'WP_Post'<\/span><span class=\"br0\">&#41;<\/span> <span class=\"sy0\">&amp;&amp;<\/span> has_shortcode<span class=\"br0\">&#40;<\/span><span class=\"re0\">$post<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">post_content<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'mon-shortcode'<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wp_enqueue_style<span class=\"br0\">&#40;<\/span><span class=\"st_h\">'mon-shortcode-style'<\/span><span class=\"sy0\">,<\/span> plugins_url<span class=\"br0\">&#40;<\/span><span class=\"st_h\">'\/mon-shortcode\/style.css'<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wp_enqueue_script<span class=\"br0\">&#40;<\/span><span class=\"st_h\">'mon-shortcode-js'<\/span><span class=\"sy0\">,<\/span> plugins_url<span class=\"br0\">&#40;<\/span><span class=\"st_h\">'\/mon-shortcode\/script.js'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">,<\/span> <a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'jquery'<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<br \/>\n<span class=\"br0\">&#125;<\/span><br \/>\n<br \/>\n<span class=\"kw2\">new<\/span> MonShortcode<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>Avec quelques am\u00e9liorations, on peux obtenir un <a href=\"https:\/\/numa-bord.com\/miniblog\/shortcode-pop-up-derniers-utilisateurs-inscrits\/\">shortcode permettant d&rsquo;afficher les derniers inscrits en popup comme sur cette page de d\u00e9monstration<\/a> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Voici ci-dessous le code tr\u00e8s simple d&rsquo;un plugin wordpress.Celui-ci permet d&rsquo;utiliser un nouveau shortcode dans le syst\u00e8me wordpress.Dans le cas pr\u00e9sent il va simplement afficher la liste des xx derniers utilisateurs inscrit sur le site. Pour l&rsquo;exemple le plugin s&rsquo;appelle \u00ab\u00a0Mon shortcode\u00a0\u00bb. Il suffit de cr\u00e9er le fichier php \u00ab\u00a0mon-shortcode.php\u00a0\u00bb avec le code ci dessous. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2,6],"tags":[],"class_list":["post-23","post","type-post","status-publish","format-standard","hentry","category-developpement","category-wordpress"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Wordpress : Cr\u00e9ation d&#039;un plugin permettant d&#039;ajouter un shortcode - Pense b\u00eate d&#039;un d\u00e9veloppeur web<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Wordpress : Cr\u00e9ation d&#039;un plugin permettant d&#039;ajouter un shortcode - Pense b\u00eate d&#039;un d\u00e9veloppeur web\" \/>\n<meta property=\"og:description\" content=\"Voici ci-dessous le code tr\u00e8s simple d&rsquo;un plugin wordpress.Celui-ci permet d&rsquo;utiliser un nouveau shortcode dans le syst\u00e8me wordpress.Dans le cas pr\u00e9sent il va simplement afficher la liste des xx derniers utilisateurs inscrit sur le site. Pour l&rsquo;exemple le plugin s&rsquo;appelle \u00ab\u00a0Mon shortcode\u00a0\u00bb. Il suffit de cr\u00e9er le fichier php \u00ab\u00a0mon-shortcode.php\u00a0\u00bb avec le code ci dessous. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/\" \/>\n<meta property=\"og:site_name\" content=\"Pense b\u00eate d&#039;un d\u00e9veloppeur web\" \/>\n<meta property=\"article:published_time\" content=\"2017-07-07T10:14:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-07-10T10:48:29+00:00\" \/>\n<meta name=\"author\" content=\"Numa\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"Numa\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/\"},\"author\":{\"name\":\"Numa\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e\"},\"headline\":\"WordPress : Cr\u00e9ation d&rsquo;un plugin permettant d&rsquo;ajouter un shortcode\",\"datePublished\":\"2017-07-07T10:14:07+00:00\",\"dateModified\":\"2017-07-10T10:48:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/\"},\"wordCount\":388,\"commentCount\":0,\"articleSection\":[\"D\u00e9veloppement\",\"Wordpress\"],\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/\",\"url\":\"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/\",\"name\":\"Wordpress : Cr\u00e9ation d'un plugin permettant d'ajouter un shortcode - Pense b\u00eate d&#039;un d\u00e9veloppeur web\",\"isPartOf\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#website\"},\"datePublished\":\"2017-07-07T10:14:07+00:00\",\"dateModified\":\"2017-07-10T10:48:29+00:00\",\"author\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e\"},\"breadcrumb\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/numa-bord.com\/miniblog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WordPress : Cr\u00e9ation d&rsquo;un plugin permettant d&rsquo;ajouter un shortcode\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#website\",\"url\":\"https:\/\/numa-bord.com\/miniblog\/\",\"name\":\"Pense b\u00eate d&#039;un d\u00e9veloppeur web\",\"description\":\"(php, javascript, Symfony, Wordpress....)\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/numa-bord.com\/miniblog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e\",\"name\":\"Numa\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g\",\"caption\":\"Numa\"},\"url\":\"https:\/\/numa-bord.com\/miniblog\/author\/negonner\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Wordpress : Cr\u00e9ation d'un plugin permettant d'ajouter un shortcode - Pense b\u00eate d&#039;un d\u00e9veloppeur web","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:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/","og_locale":"fr_FR","og_type":"article","og_title":"Wordpress : Cr\u00e9ation d'un plugin permettant d'ajouter un shortcode - Pense b\u00eate d&#039;un d\u00e9veloppeur web","og_description":"Voici ci-dessous le code tr\u00e8s simple d&rsquo;un plugin wordpress.Celui-ci permet d&rsquo;utiliser un nouveau shortcode dans le syst\u00e8me wordpress.Dans le cas pr\u00e9sent il va simplement afficher la liste des xx derniers utilisateurs inscrit sur le site. Pour l&rsquo;exemple le plugin s&rsquo;appelle \u00ab\u00a0Mon shortcode\u00a0\u00bb. Il suffit de cr\u00e9er le fichier php \u00ab\u00a0mon-shortcode.php\u00a0\u00bb avec le code ci dessous. [&hellip;]","og_url":"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/","og_site_name":"Pense b\u00eate d&#039;un d\u00e9veloppeur web","article_published_time":"2017-07-07T10:14:07+00:00","article_modified_time":"2017-07-10T10:48:29+00:00","author":"Numa","twitter_card":"summary_large_image","twitter_misc":{"\u00c9crit par":"Numa","Dur\u00e9e de lecture estim\u00e9e":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/#article","isPartOf":{"@id":"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/"},"author":{"name":"Numa","@id":"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e"},"headline":"WordPress : Cr\u00e9ation d&rsquo;un plugin permettant d&rsquo;ajouter un shortcode","datePublished":"2017-07-07T10:14:07+00:00","dateModified":"2017-07-10T10:48:29+00:00","mainEntityOfPage":{"@id":"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/"},"wordCount":388,"commentCount":0,"articleSection":["D\u00e9veloppement","Wordpress"],"inLanguage":"fr-FR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/","url":"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/","name":"Wordpress : Cr\u00e9ation d'un plugin permettant d'ajouter un shortcode - Pense b\u00eate d&#039;un d\u00e9veloppeur web","isPartOf":{"@id":"https:\/\/numa-bord.com\/miniblog\/#website"},"datePublished":"2017-07-07T10:14:07+00:00","dateModified":"2017-07-10T10:48:29+00:00","author":{"@id":"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e"},"breadcrumb":{"@id":"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/numa-bord.com\/miniblog\/wordpress-creation-dun-plugin-permettant-dajouter-shortcode\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/numa-bord.com\/miniblog\/"},{"@type":"ListItem","position":2,"name":"WordPress : Cr\u00e9ation d&rsquo;un plugin permettant d&rsquo;ajouter un shortcode"}]},{"@type":"WebSite","@id":"https:\/\/numa-bord.com\/miniblog\/#website","url":"https:\/\/numa-bord.com\/miniblog\/","name":"Pense b\u00eate d&#039;un d\u00e9veloppeur web","description":"(php, javascript, Symfony, Wordpress....)","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/numa-bord.com\/miniblog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Person","@id":"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e","name":"Numa","image":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g","caption":"Numa"},"url":"https:\/\/numa-bord.com\/miniblog\/author\/negonner\/"}]}},"_links":{"self":[{"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/posts\/23","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/comments?post=23"}],"version-history":[{"count":10,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/posts\/23\/revisions"}],"predecessor-version":[{"id":45,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/posts\/23\/revisions\/45"}],"wp:attachment":[{"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/media?parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/categories?post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/tags?post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}