{"id":17081,"date":"2012-02-28T15:45:27","date_gmt":"2012-02-28T15:45:27","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/functionscapacitor\/"},"modified":"2014-10-29T16:49:36","modified_gmt":"2014-10-29T16:49:36","slug":"functionscapacitor","status":"publish","type":"plugin","link":"https:\/\/twd.wordpress.org\/plugins\/functionscapacitor\/","author":7167647,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.9.6","stable_tag":"trunk","tested":"4.0.0","requires":"3.0.1","requires_php":"","requires_plugins":"","header_name":"functionsCapacitor","header_author":"oliezekat","header_description":"","assets_banners_color":"a7a7a7","last_updated":"2014-10-29 16:49:36","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/wordpress.org\/extend\/plugins\/functionscapacitor\/","header_author_uri":"http:\/\/life2front.com\/oliezekat","rating":5,"author_block_rating":0,"active_installs":10,"downloads":3282,"num_ratings":1,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"1"},"assets_icons":[],"assets_banners":{"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":"515014","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.8","0.9","0.9.2","0.9.3","0.9.4","0.9.5","0.9.6"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1556,18683,529,86,80],"plugin_category":[43,51,57],"plugin_contributors":[96932],"plugin_business_model":[],"class_list":["post-17081","plugin","type-plugin","status-publish","hentry","plugin_tags-api","plugin_tags-codex","plugin_tags-content","plugin_tags-post","plugin_tags-shortcode","plugin_category-customization","plugin_category-multisite","plugin_category-taxonomy","plugin_contributors-oliezekat","plugin_committers-oliezekat"],"banners":{"banner":"https:\/\/ps.w.org\/functionscapacitor\/assets\/banner-772x250.jpg?rev=515014","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/functionscapacitor_a7a7a7.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<blockquote>\n  <p>Back WordPress API to the content.<\/p>\n<\/blockquote>\n\n<p>You can request some* functions of WordPress API with same syntax for arguments into your posts, pages, or widgets content.\n functionsCapacitor will insert function result into your content as HTML output.<\/p>\n\n<p>(*) see <a href=\"http:\/\/wordpress.org\/extend\/plugins\/functionscapacitor\/other_notes\/#Supported-functions\">Supported functions<\/a>\nor <a href=\"http:\/\/wordpress.org\/extend\/plugins\/functionscapacitor\/other_notes\/#Supported-conditional-functions\">conditional tags<\/a>.<\/p>\n\n<h4>Features<\/h4>\n\n<ul>\n<li>Safe process to use this plugin on WordPress MU or WP MultiSite.<\/li>\n<li>Allow to personalize <a href=\"http:\/\/wordpress.org\/extend\/plugins\/functionscapacitor\/other_notes\/#Embedded-output\">Embedded output<\/a>\nfor each functions.<\/li>\n<li>Easy and powerfull <a href=\"http:\/\/wordpress.org\/extend\/plugins\/functionscapacitor\/other_notes\/#Functions-arguments-syntax\">Functions arguments syntax<\/a>\nto apply any WordPress API options.<\/li>\n<li>Generic functions arguments with <a href=\"http:\/\/wordpress.org\/extend\/plugins\/functionscapacitor\/other_notes\/#Magic-keywords\">Magic keywords<\/a>.<\/li>\n<li>NEW: use <a href=\"http:\/\/wordpress.org\/extend\/plugins\/functionscapacitor\/other_notes\/#Supported-conditional-functions\">WordPress conditional tags<\/a> as option to display a widget.<\/li>\n<li>Structured source-code to prevent any conflict.<\/li>\n<\/ul>\n\n<p>Three methods to use WordPress API functions :<\/p>\n\n<h4>Method by shortcode tag<\/h4>\n\n<p>Insert a tag into your content like [fct function_name=\"parameter1=value&amp;parameter2=value\"].<\/p>\n\n<p>One shortcode tag can request several functions, input [fct function_name1=\"arguments\" function_name2=\"arguments\"].<\/p>\n\n<h4>Method with a widget<\/h4>\n\n<p>Add a functionsCapacitor widget, select a function, input function parameters like \"parameter1=value&amp;parameter2=value\" (without quotes).<\/p>\n\n<p>Optional: choose a <a href=\"http:\/\/wordpress.org\/extend\/plugins\/functionscapacitor\/other_notes\/#Supported-conditional-functions\">supported conditional function<\/a> to decide where to display your widget.<\/p>\n\n<h4>Method by custom fields<\/h4>\n\n<p>Set a custom field name with function name and put function arguments into custom field value like \"parameter1=value&amp;parameter2=value\" (without quotes).<\/p>\n\n<ul>\n<li>Result is always inserted at end.<\/li>\n<li>Plugin has priority 5. Most plugins use priority 10.<\/li>\n<li>This method is applied if post\/page is displayed.<\/li>\n<\/ul>\n\n<h4>Examples<\/h4>\n\n<ul>\n<li>Tag cloud of popular posts tags,\ninsert [fct wp_tag_cloud]<\/li>\n<li>List of children pages of current page,\ninsert [fct wp_list_pages=\"title_li=&amp;child_of=%postID%&amp;depth=1\"]<\/li>\n<li>List of category's recent posts with excerpts,\ninsert [fct wp_get_recent_posts=\"category=X&amp;fct:show_excerpt=1\"]\nwith X equal category ID number<\/li>\n<li>List of categories without default category,\ninsert [fct wp_list_categories=\"title_li=&amp;exclude=%defaultcatID%\"]<\/li>\n<\/ul>\n\n<h3>Embedded output<\/h3>\n\n<p>Any functionsCapacitor request will insert <code>&lt;div class=\"functionsCapacitor\"&gt;functions output&lt;\/div&gt;<\/code>.\n Shortcode method allow to personalize main container like\n [fct container=\"HTML tag name\" class=\"class(es) name(s)\" style=\"CSS properties\" function1=\"args\" function2=\"args\"].\n set container=\"\" to remove main container.<\/p>\n\n<p>Some functions output were inserted with dedicated container like<\/p>\n\n<ul>function output<\/ul>\n\n<p>or <code>&lt;div class=\"function_name\"&gt;function output&lt;\/div&gt;<\/code>.\n Personalize this container with <a href=\"http:\/\/wordpress.org\/extend\/plugins\/functionscapacitor\/other_notes\/#Special-functions-parameters\">Special functions parameters<\/a>.<\/p>\n\n<h3>Functions arguments syntax<\/h3>\n\n<p>Follow these examples to setup your requests :<\/p>\n\n<ul>\n<li>\"parameter1=something&amp;parameter2=25\",\nparameter1 and parameter2 typed as strings.<\/li>\n<li>\"parameter1=something&amp;parameter2=false\",\nparameter2 typed as boolean.<\/li>\n<li>\"parameter1=&amp;parameter2= &amp;parameter3=''\",\nany parameters equal empty string.<\/li>\n<li>\"parameter1= something &amp;parameter2=' something '\",\nparameter1 equal 'something',\nparameter2 equal ' something '.<\/li>\n<li>\"parameter1=something&amp;parameter2=array('something','something')\",\nparameter2 typed as an array of 2 strings.<\/li>\n<li>\"parameter1=something&amp;parameter2=array(10,5,20)\",\nparameter2 typed as an array of 3 integers.<\/li>\n<li>\"parameter1=something&amp;parameter2=array(true,false)\",\nparameter2 typed as an array of 2 booleans.<\/li>\n<\/ul>\n\n<p>Not supported issues :<\/p>\n\n<ul>\n<li>parameter's value can't contain \"&amp;\" or \"=\" characters.<\/li>\n<li>parameter's value can't contain an associative array like array('name'=&gt;value,'name'=&gt;value).<\/li>\n<li>parameter's value can't contain an array of arrays.<\/li>\n<li>parameter's value can't contain a PHP variable like $post-&gt;ID,\nsee <a href=\"http:\/\/wordpress.org\/extend\/plugins\/functionscapacitor\/other_notes\/#Magic-keywords\">Magic keywords<\/a>.<\/li>\n<li>parameter's value can't request a PHP or WordPress function.<\/li>\n<li>parameter's value can't contain PHP source-code.<\/li>\n<\/ul>\n\n<h3>Magic keywords<\/h3>\n\n<p>Use these keywords to obtain variables values into your functions arguments :<\/p>\n\n<ul>\n<li>%postID% =&gt; $post-&gt;ID,\nID of post or page where made the request :\nrelated post\/page into a shortcode,\nor current post\/page into a widget.<\/li>\n<li>%postparent% =&gt; $post-&gt;post_parent,\nID of parent page where made the request.<\/li>\n<li>%postauthor% =&gt; $post-&gt;post_author,\nauthor ID of post where made the request.<\/li>\n<li>%defaultcatID% =&gt; default_category,\nID of default category for newest posts.<\/li>\n<li>%posttagIDs% =&gt; wp_get_post_tags(),\nstring of current post tags IDs as \"1,2,3,...\"<\/li>\n<li>%posttagslugs% =&gt; wp_get_post_tags(),\nstring of current post tags slugs as \"slug-name,slug-name,...\"<\/li>\n<\/ul>\n\n<p>You can use magic keywords into an array.\n Example: wp_list_categories=\"exclude=array(%defaultcatID%,1,2,...)\"<\/p>\n\n<h3>Special functions parameters<\/h3>\n\n<ul>\n<li>fct:container to set HTML tag of function container.\nSet \"fct:container=''\" to remove this container.\nEach functions have a default container related to its output.<\/li>\n<li>fct:container_id to set container \"id\" attribute.<\/li>\n<li>fct:container_class to set container \"class\" attribute.\nFunction name as default.\nExample with shortcode: [fct function_name=\"fct:container_class=name&amp;param1=value&amp;param2=value\"].<\/li>\n<li>fct:container_style to set container \"style\" attribute.<\/li>\n<\/ul>\n\n<p>functionsCapacitor not create a container if the API function still return a container.\n See <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\" title=\"Wordpress documentation\">WordPress Codex<\/a> to personalize them.<\/p>\n\n<h3>Supported functions<\/h3>\n\n<ul>\n<li>get_the_post_thumbnail()\nwith size=thumbnail|medium|large|post-thumbnail\nor size name defined with add_image_size() into theme's file functions.php.<\/li>\n<li>get_the_tag_list()\nwith before=''&amp;sep=' '&amp;after='' as default,\napply only on page or post,\nrendered into DIV container<\/li>\n<li>wp_get_archives()\nwith echo=0&amp;format=html as default<\/li>\n<li>wp_get_recent_posts()\nrendered as list with UL container,\nwith exclude=%postID%&amp;suppress_filters=false&amp;post_status=publish&amp;fct:perm=readable as default\n(see bellow)<\/li>\n<li>wp_list_authors()\nwith echo=0 as default<\/li>\n<li>wp_list_bookmarks()\nwith echo=0 as default<\/li>\n<li>wp_list_categories()\nwith echo=0 as default<\/li>\n<li>wp_list_pages()\nwith echo=0 as default<\/li>\n<li>wp_nav_menu()\nwith echo=false as default,\nsee Codex to setting its container<\/li>\n<li>wp_tag_cloud()\nwith echo=0 as default,\nformat=flat|list only<\/li>\n<\/ul>\n\n<p>See <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\" title=\"Wordpress documentation\">WordPress Codex<\/a> about these functions and their arguments syntax.<\/p>\n\n<p>Need you to support more functions, mail to oliezekat@yahoo.fr<\/p>\n\n<h4>wp_get_recent_posts()<\/h4>\n\n<ul>\n<li>if fct:perm=readable hide draft, future, pending, protected posts\nbut display private posts if user is allowed.<\/li>\n<li>if fct:perm='' not output permalink of draft, future, pending, private posts.<\/li>\n<li>set fct:show_excerpt=1|true to display posts excerpts.<\/li>\n<li>set fct:show_date=1|true to display posts dates.<\/li>\n<li>set fct:show_thumbnail=1|true to display post thumbnail,\nwith fct:thumbnail_size=thumbnail|medium|large|post-thumbnail\nor size name defined with add_image_size() into theme's file functions.php.<\/li>\n<li>fct:show_thumbnail=true if fct:thumbnail_size is defined<\/li>\n<li>display excerpt and thumbnail for draft, future, pending, private, and protected posts\nbut not create an excerpt from content.<\/li>\n<\/ul>\n\n<h3>Supported conditional functions<\/h3>\n\n<ul>\n<li>cat_is_ancestor_of()\ncheck if current category is child of conditional argument.<\/li>\n<li>in_category()<\/li>\n<li>is_category()<\/li>\n<li>is_front_page()<\/li>\n<li>is_home()<\/li>\n<li>is_page()<\/li>\n<li>is_single()<\/li>\n<\/ul>\n\n<p>See <a href=\"http:\/\/codex.wordpress.org\/Conditional_Tags\" title=\"Wordpress documentation\">WordPress Conditional Tags<\/a> about these functions and their arguments syntax.<\/p>\n\n<h4>Not canonical conditional functions<\/h4>\n\n<p>These functions are designed for this plugin only, not available elsewhere, and not documented into the WordPress Codex.<\/p>\n\n<ul>\n<li>in_tree_of()\ncheck if page, post, or category is descendant of conditional argument (or itself),\nrequire argument as page or category numeric ID.<\/li>\n<li>is_category_in_tree_of()\ncheck if category is descendant of conditional argument (or itself),\nrequire argument as category numeric ID.<\/li>\n<li>is_page_descendant_of()\ncheck if page is descendant of conditional argument,\nrequire argument as page numeric ID.<\/li>\n<li>is_page_in_tree_of()\ncheck if page is descendant of conditional argument (or itself),\nrequire argument as page numeric ID.<\/li>\n<li>is_single_in_tree_of()\ncheck if post is in descendant of conditional argument,\nrequire argument as category numeric ID.<\/li>\n<\/ul>\n\n<h4>Conditional functions arguments syntax<\/h4>\n\n<p>Support only arguments as single value ; string, numeric, or <a href=\"http:\/\/wordpress.org\/extend\/plugins\/functionscapacitor\/other_notes\/#Magic-keywords\">magic keyword<\/a>.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload <code>functionscapacitor.php<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Is it safe ?<\/dt>\n<dd><p>Yes ! And you can install functionsCapacitor on WPMU or WPMS.<\/p>\n\n<ul>\n<li>functionsCapacitor not execute or eval users input (function name or arguments).<\/li>\n<li>functionsCapacitor output is managed by WordPress itself, and related to users role.\nExample: wp_list_pages() function will not return private pages if current user is anonymous.<\/li>\n<\/ul><\/dd>\n<dt>How come from functions capacitor idea ?<\/dt>\n<dd><blockquote>\n  <p>I was standing on my chair in front of the computer,\n  I was copy-paste a hack into a template,\n  the desk was wet,\n  my mouse slipped, right button hit the flowerpot,\n  and when I saw the result on screen I had a revelation ! A vision !\n  The functions capacitor !<\/p>\n<\/blockquote><\/dd>\n<dt>D'o\u00f9 vient l'id\u00e9e du convecteur de fonctions ?<\/dt>\n<dd><blockquote>\n  <p>J'\u00e9tais assis devant mon ordinateur,\n  j'allais copier-coller un hack dans un template,\n  le bureau \u00e9tait mouill\u00e9,\n  ma souris a gliss\u00e9, le bouton-droit a heurt\u00e9 le pot de fleurs,\n  et en voyant le r\u00e9sultat \u00e0 l'\u00e9cran j'ai eu une r\u00e9v\u00e9lation ! Une vision !\n  Le convecteur de fonctions !<\/p>\n<\/blockquote><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>0.9.6<\/h4>\n\n<ul>\n<li>support is_page() conditional function.<\/li>\n<li>add is_page_in_tree_of() conditional function (not canonical).<\/li>\n<li>in_tree_of() support page ID as argument.<\/li>\n<li>add is_page_descendant_of() conditional function (not canonical).<\/li>\n<li>Tested with WordPress 4.0 (and 3.5.1).<\/li>\n<\/ul>\n\n<h4>0.9.5<\/h4>\n\n<ul>\n<li>fix issue while esc_textarea() API is missing.<\/li>\n<li>support is_category() conditional function.<\/li>\n<li>support cat_is_ancestor_of() conditional function.<\/li>\n<li>support is_single() conditional function.<\/li>\n<li>support in_category() conditional function.<\/li>\n<li>add is_category_in_tree_of() conditional function (not canonical).<\/li>\n<li>add is_single_in_tree_of() conditional function (not canonical).<\/li>\n<li>add in_tree_of() conditional function (not canonical).<\/li>\n<li>support get_the_post_thumbnail() function.<\/li>\n<\/ul>\n\n<h4>0.9.4<\/h4>\n\n<ul>\n<li>add fct:show_date for wp_get_recent_posts().<\/li>\n<li>add fct:container_id special parameter.<\/li>\n<\/ul>\n\n<h4>0.9.3<\/h4>\n\n<ul>\n<li>add conditional options to choose when to display or not a widget,<\/li>\n<li>support is_home() conditional function.<\/li>\n<li>support is_front_page() conditional function.<\/li>\n<\/ul>\n\n<h4>0.9.2<\/h4>\n\n<ul>\n<li>set post_status=publish as default for wp_get_recent_posts().<\/li>\n<li>allow post_status=draft|future|pending for wp_get_recent_posts(),\nbut require to set fct:perm='' to display these posts.<\/li>\n<li>if request wp_get_recent_posts() with fct:perm='',\nany posts with as draft, future, pending, private status are display without permalink.<\/li>\n<\/ul>\n\n<h4>0.9<\/h4>\n\n<ul>\n<li>add fct:perm=readable for wp_get_recent_posts().<\/li>\n<\/ul>\n\n<h4>0.8<\/h4>\n\n<ul>\n<li>add fct:container special parameter.<\/li>\n<li>support get_the_tag_list().<\/li>\n<li>allow to personalize \"style\" attribute of shortcode main container.<\/li>\n<li>add fct:container_style special parameter.<\/li>\n<li>add %defaultcatID% magic keyword.<\/li>\n<li>add %posttagIDs% magic keyword.<\/li>\n<li>add %posttagslugs% magic keyword.<\/li>\n<\/ul>\n\n<h4>0.7<\/h4>\n\n<ul>\n<li>add fct:show_thumbnail and fct:thumbnail_size parameters for wp_get_recent_posts().<\/li>\n<li>allow to personalize shortcode main container.<\/li>\n<\/ul>\n\n<h4>0.6<\/h4>\n\n<ul>\n<li>support wp_list_authors().<\/li>\n<li>add %postparent% magic keyword.<\/li>\n<li>add %postauthor% magic keyword.<\/li>\n<\/ul>\n\n<h4>0.5<\/h4>\n\n<ul>\n<li>purpose to use API's functions as a widget.<\/li>\n<li>set \"exclude=%postID%\" as default for wp_get_recent_posts().<\/li>\n<\/ul>\n\n<h4>0.4<\/h4>\n\n<ul>\n<li>support wp_get_recent_posts() as UL list rendering.<\/li>\n<li>support parameter value as an array of strings, integers, or booleans\nlike \"parameter=array('string',integer,true,false,...)\".<\/li>\n<li>check an API function exists.<\/li>\n<li>add special parameter \"fct:container_class=class(es) name(s)\".<\/li>\n<\/ul>\n\n<h4>0.3<\/h4>\n\n<ul>\n<li>support wp_tag_cloud() function.<\/li>\n<\/ul>\n\n<h4>0.2<\/h4>\n\n<ul>\n<li>support wp_nav_menu() function.<\/li>\n<li>fix function arguments processing from shortcode tag.<\/li>\n<\/ul>\n\n<h4>0.1<\/h4>\n\n<ul>\n<li>Experimental release which support wp_get_archives(), wp_list_bookmarks(), wp_list_categories(), and wp_list_pages().<\/li>\n<\/ul>","raw_excerpt":"This plugin allow to apply some WordPress API&#039;s functions into your post\/page content or as a widget.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/17081","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=17081"}],"author":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/oliezekat"}],"wp:attachment":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=17081"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=17081"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=17081"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=17081"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=17081"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=17081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}