{"id":3873,"date":"2010-06-15T00:19:59","date_gmt":"2010-06-14T23:19:59","guid":{"rendered":"http:\/\/www.pesadillo.com\/pesadillo\/?p=3873"},"modified":"2010-05-25T13:20:32","modified_gmt":"2010-05-25T12:20:32","slug":"crear-un-plugin-widget-para-wordpress-ejemplo","status":"publish","type":"post","link":"https:\/\/www.pesadillo.com\/pesadillo\/?p=3873","title":{"rendered":"Crear un plugin (widget) para wordpress ejemplo"},"content":{"rendered":"<p>[php]<br \/>\n&lt; ?php<br \/>\n\/*<br \/>\nPlugin Name: Mi Primer Plugin<br \/>\nPlugin URI: &lt;A href=&quot;http:\/\/jodacame.wordpress.com&quot; rel=nofollow&gt;http:\/\/jodacame.wordpress.com&lt;\/A&gt;<br \/>\nDescription:Mi Primer Plugin para wordpress<br \/>\nAuthor: Jose Daniel Canchila Mercado<br \/>\nVersion: Beta<br \/>\nAuthor URI: &lt;A href=&quot;http:\/\/Jodacame.wordpress.com&quot; rel=nofollow&gt;http:\/\/Jodacame.wordpress.com&lt;\/A&gt;<br \/>\n*\/<\/p>\n<p>function Mi_Plugin($args) {<\/p>\n<p>extract($args);<br \/>\n $nom_plugin = plugin_basename(dirname(__FILE__)); \/\/Con esto tenemos el nombre de la carpeta del plugin<br \/>\n$url_plugin= WP_PLUGIN_URL.&#8217;\/&#8217;. $nom_plugin ;  \/\/Con esto armamos la ruta del plugin, es ultil para insertar imagenes y codigo css<\/p>\n<p>echo $before_widget;<\/p>\n<p>echo $before_title. &#8216;Titulo del Plugin&#8217;. $after_title; <\/p>\n<p>?&gt;<br \/>\n&lt;h1&gt;Aqui va el codigo HTML\/JavaScript o PHP&lt;\/h1&gt;<br \/>\n&lt; ?php<br \/>\necho $after_widget;<\/p>\n<p>}<\/p>\n<p>function init_Mi_Plugin(){<br \/>\n register_sidebar_widget(&quot;Mi Primer Plugin&quot;, &quot;Mi_Plugin&quot;);}<\/p>\n<p>add_action(&quot;plugins_loaded&quot;, &quot;init_Mi_Plugin&quot;);<br \/>\n?&gt;[\/php]<br \/>\nFuente:<br \/>\n\u00a0<a href=\"http:\/\/jodacame.wordpress.com\/2009\/08\/19\/crear-un-plugin-widget-para-wordpress-ejemplo\/\" target=\"_blank\">http:\/\/jodacame.wordpress.com\/2009\/08\/19\/crear-un-plugin-widget-para-wordpress-ejemplo\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[php] &lt; ?php \/* Plugin Name: Mi Primer Plugin Plugin URI: &lt;A href=&quot;http:\/\/jodacame.wordpress.com&quot; rel=nofollow&gt;http:\/\/jodacame.wordpress.com&lt;\/A&gt; Description:Mi Primer Plugin para wordpress Author: Jose Daniel Canchila Mercado Version: Beta Author URI: &lt;A href=&quot;http:\/\/Jodacame.wordpress.com&quot; rel=nofollow&gt;http:\/\/Jodacame.wordpress.com&lt;\/A&gt; *\/ function Mi_Plugin($args) { extract($args); $nom_plugin = plugin_basename(dirname(__FILE__)); \/\/Con esto tenemos el nombre de la carpeta del plugin $url_plugin= WP_PLUGIN_URL.&#8217;\/&#8217;. $nom_plugin ; \/\/Con esto armamos la ruta del plugin, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[70],"class_list":["post-3873","post","type-post","status-publish","format-standard","hentry","category-informatica","tag-informatica"],"_links":{"self":[{"href":"https:\/\/www.pesadillo.com\/pesadillo\/index.php?rest_route=\/wp\/v2\/posts\/3873","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pesadillo.com\/pesadillo\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pesadillo.com\/pesadillo\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pesadillo.com\/pesadillo\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pesadillo.com\/pesadillo\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3873"}],"version-history":[{"count":2,"href":"https:\/\/www.pesadillo.com\/pesadillo\/index.php?rest_route=\/wp\/v2\/posts\/3873\/revisions"}],"predecessor-version":[{"id":3875,"href":"https:\/\/www.pesadillo.com\/pesadillo\/index.php?rest_route=\/wp\/v2\/posts\/3873\/revisions\/3875"}],"wp:attachment":[{"href":"https:\/\/www.pesadillo.com\/pesadillo\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pesadillo.com\/pesadillo\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pesadillo.com\/pesadillo\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}