{"id":183427,"date":"2025-08-12T13:01:26","date_gmt":"2025-08-12T13:01:26","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/anything-shortcodes\/"},"modified":"2025-10-07T07:55:36","modified_gmt":"2025-10-07T07:55:36","slug":"anything-shortcodes","status":"publish","type":"plugin","link":"https:\/\/os.wordpress.org\/plugins\/anything-shortcodes\/","author":18430680,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.3.0","stable_tag":"1.3.0","tested":"6.8.5","requires":"5.0","requires_php":"7.4","requires_plugins":null,"header_name":"Anything Shortcodes","header_author":"WPizard","header_description":"Ready-to-use shortcodes for accessing any data in WordPress.","assets_banners_color":"","last_updated":"2025-10-07 07:55:36","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/anything-shortcodes","header_author_uri":"https:\/\/wpizard.com\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":545,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"re.ardestani","date":"2025-08-12 13:32:12"},"1.1.0":{"tag":"1.1.0","author":"wpizard","date":"2025-08-15 07:30:21"},"1.2.0":{"tag":"1.2.0","author":"re.ardestani","date":"2025-09-29 06:29:06"},"1.3.0":{"tag":"1.3.0","author":"re.ardestani","date":"2025-10-07 07:55:36"}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3343608,"resolution":"128x128","location":"assets","locale":""}},"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.1.0","1.2.0","1.3.0"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[2218,86,4586,80,2153],"plugin_category":[43],"plugin_contributors":[201947],"plugin_business_model":[],"class_list":["post-183427","plugin","type-plugin","status-publish","hentry","plugin_tags-options","plugin_tags-post","plugin_tags-post-meta","plugin_tags-shortcode","plugin_tags-user","plugin_category-customization","plugin_contributors-wpizard","plugin_committers-reardestani","plugin_committers-wpizard"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/anything-shortcodes\/assets\/icon-128x128.png?rev=3343608","icon_2x":false,"generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>A powerful WordPress plugin that lets you retrieve and display virtually any data in WordPress using simple shortcodes. Effortlessly pull information from posts, users, options, and more \u2014 with support for dynamic attribute parsing, flexible formatting, and customizable output wrapping.<\/p>\n\n<p>It supports:\n- Post Field\n- Post Meta\n- Term Field\n- Term Meta (coming soon)\n- User Field\n- User Meta\n- Link\n- Option\n- Function (whitelisted)<\/p>\n\n<p>You can also:\n- Apply custom formatting (date, datetime, number, capitalize, uppercase, lowercase, strip_tags, etc.)\n- Add before\/after text\n- Use fallback values\n- Use nested shortcodes inside attributes\n- Use URL parameters as values\n- Cache output\n- Secure and sanitize output<\/p>\n\n<h3>Shortcode Usage<\/h3>\n\n<p><strong>General syntax:<\/strong>\n    <code>[anys type=\"TYPE\" name=\"KEY\" id=\"ID\" before=\"TEXT\" after=\"TEXT\" fallback=\"TEXT\" format=\"FORMAT\" delimiter=\"DELIMITER\"]<\/code><\/p>\n\n<p><strong>Attributes:<\/strong>\n- <code>type<\/code> \u2014 <code>post-field<\/code>, <code>post-meta<\/code>, <code>user-field<\/code>, <code>user-meta<\/code>, <code>option<\/code>, <code>function<\/code> (required)\n- <code>name<\/code> \u2014 The field name, meta key, option name, or function call (required)\n- <code>id<\/code> \u2014 Post ID or User ID (optional; defaults to current context)\n- <code>before<\/code> \u2014 Text to prepend before output (optional)\n- <code>after<\/code> \u2014 Text to append after output (optional)\n- <code>fallback<\/code> \u2014 Value if empty (optional)\n- <code>format<\/code> \u2014 Output formatting type (optional: <code>date<\/code>, <code>datetime<\/code>, <code>number<\/code>, <code>capitalize<\/code>, <code>uppercase<\/code>, <code>lowercase<\/code>, <code>strip_tags<\/code>, <code>values<\/code>, <code>keys_values<\/code>, etc.)\n- <code>delimiter<\/code> \u2014 Separator used to join multiple values (optional)<\/p>\n\n<h3>Supported Types and Examples<\/h3>\n\n<p><strong>Post Field<\/strong>\nRetrieve standard post fields by name.<\/p>\n\n<p>Examples:<\/p>\n\n<ul>\n<li><code>[anys type=\"post-field\" name=\"post_title\"]<\/code> \u2014 Shows the post title.<\/li>\n<li><code>[anys type=\"post-field\" name=\"post_date\" format=\"date\"]<\/code> \u2014 Shows the post publish date (formatted).<\/li>\n<li><code>[anys type=\"post-field\" name=\"post_author\" id=\"123\"]<\/code> \u2014 Shows the author ID of post <code>123<\/code>.<\/li>\n<li><code>[anys type=\"post-field\" name=\"post_content\" fallback=\"No content\"]<\/code> \u2014 Shows the post content or fallback text.<\/li>\n<\/ul>\n\n<p>Other fields supported: <code>ID<\/code>, <code>post_name<\/code>, <code>post_excerpt<\/code>, <code>post_status<\/code>, <code>comment_status<\/code>, <code>ping_status<\/code>, <code>post_password<\/code>, <code>post_parent<\/code>, <code>menu_order<\/code>, <code>guid<\/code>, <code>post_type<\/code>, <code>post_mime_type<\/code>, <code>post_modified<\/code>, <code>post_modified_gmt<\/code><\/p>\n\n<p><strong>Post Meta<\/strong>\nRetrieve post meta by key.<\/p>\n\n<p>Examples:<\/p>\n\n<ul>\n<li><code>[anys type=\"post-meta\" name=\"my_meta_key\"]<\/code> \u2014 Shows value of <code>my_meta_key<\/code>.<\/li>\n<li><code>[anys type=\"post-meta\" name=\"price\" id=\"456\" format=\"number\"]<\/code> \u2014 Shows the <code>price<\/code> of post <code>456<\/code>, formatted as number.<\/li>\n<li><code>[anys type=\"post-meta\" name=\"release_date\" format=\"date\"]<\/code> \u2014 Shows release date formatted as date.<\/li>\n<\/ul>\n\n<p><strong>Term Field<\/strong>\nRetrieve standard term fields by name.<\/p>\n\n<p>Examples:<\/p>\n\n<ul>\n<li><code>[anys type=\"term-field\" name=\"name\"]<\/code> \u2014 Shows the term name.<\/li>\n<li><code>[anys type=\"term-field\" name=\"slug\"]<\/code> \u2014 Shows the term slug.<\/li>\n<li><code>[anys type=\"term-field\" name=\"term_id\" id=\"15\"]<\/code> \u2014 Shows the ID of term <code>15<\/code>.<\/li>\n<li><code>[anys type=\"term-field\" name=\"taxonomy\" id=\"15\"]<\/code> \u2014 Shows the taxonomy of term <code>15<\/code>.<\/li>\n<li><code>[anys type=\"term-field\" name=\"description\" fallback=\"No description\"]<\/code> \u2014 Shows term description or fallback text.<\/li>\n<li><code>[anys type=\"term-field\" name=\"count\" id=\"15\" format=\"number\"]<\/code> \u2014 Shows the number of posts in term <code>15<\/code>.<\/li>\n<\/ul>\n\n<p>Other fields supported: <code>term_group<\/code>, <code>parent<\/code><\/p>\n\n<p>Notes:\n- If no \"id\" is provided, it defaults to the current queried term (e.g., category\/tag archive page).\n- Supports \"before\", \"after\", \"fallback\", and \"format\" (for number, date, etc.).<\/p>\n\n<p><strong>User Field<\/strong>\nRetrieve user standard fields.<\/p>\n\n<p>Examples:<\/p>\n\n<ul>\n<li><code>[anys type=\"user-field\" name=\"user_email\" id=\"12\"]<\/code> \u2014 Shows email of user <code>12<\/code>.<\/li>\n<li><code>[anys type=\"user-field\" name=\"display_name\"]<\/code> \u2014 Shows current user display name.<\/li>\n<li><code>[anys type=\"user-field\" name=\"user_registered\" format=\"date\"]<\/code> \u2014 Shows user registration date.<\/li>\n<\/ul>\n\n<p>Common user fields: <code>ID<\/code>, <code>user_login<\/code>, <code>user_nicename<\/code>, <code>user_url<\/code>, <code>user_activation_key<\/code>, <code>user_status<\/code>, <code>description<\/code><\/p>\n\n<p><strong>User Meta<\/strong>\nRetrieve user meta by key.<\/p>\n\n<p>Examples:<\/p>\n\n<ul>\n<li><code>[anys type=\"user-meta\" name=\"favorite_color\" id=\"12\"]<\/code> \u2014 Shows favorite_color of user <code>12<\/code>.<\/li>\n<li><code>[anys type=\"user-meta\" name=\"profile_phone\"]<\/code> \u2014 Shows current user\u2019s phone.<\/li>\n<\/ul>\n\n<p><strong>Link<\/strong>\nRetrieve URLs or generate link anchors for common WordPress locations.<\/p>\n\n<p>Examples:<\/p>\n\n<ul>\n<li><code>[anys type=\"link\" name=\"logout\"]<\/code> \u2014 Returns the logout URL.<\/li>\n<li><code>[anys type=\"link\" name=\"logout\" redirect=\"\/\"]<\/code> \u2014 Returns the logout URL and redirects to home after logout.<\/li>\n<li><code>[anys type=\"link\" name=\"login\" redirect=\"\/dashboard\"]<\/code> \u2014 Returns the login URL with redirect to <code>\/dashboard<\/code>.<\/li>\n<li><code>[anys type=\"link\" name=\"register\"]<\/code> \u2014 Returns the registration URL.<\/li>\n<li><code>[anys type=\"link\" name=\"home\"]<\/code> \u2014 Returns the home page URL.<\/li>\n<li><code>[anys type=\"link\" name=\"siteurl\"]<\/code> \u2014 Returns the main site URL.<\/li>\n<li><code>[anys type=\"link\" name=\"admin\"]<\/code> \u2014 Returns the WordPress admin URL.<\/li>\n<li><code>[anys type=\"link\" name=\"profile\"]<\/code> \u2014 Returns the user profile page URL.<\/li>\n<li><code>[anys type=\"link\" name=\"post\" id=\"123\"]<\/code> \u2014 Returns the permalink for post with ID <code>123<\/code>.<\/li>\n<li><code>[anys type=\"link\" name=\"term\" id=\"45\"]<\/code> \u2014 Returns the archive link for term with ID <code>45<\/code>.<\/li>\n<li><code>[anys type=\"link\" name=\"current\"]<\/code> \u2014 Returns the current page URL.<\/li>\n<li><code>[anys type=\"link\" name=\"auth\"]<\/code> \u2014 Dynamically returns the login or logout URL based on user status.<\/li>\n<\/ul>\n\n<p>Formatting options:<\/p>\n\n<ul>\n<li><code>[anys type=\"link\" name=\"logout\" format=\"anchor\"]<\/code> \u2014 Outputs a clickable link: <code>&lt;a href=\"...\"&gt;Logout&lt;\/a&gt;<\/code>.<\/li>\n<li><code>[anys type=\"link\" name=\"auth\" format=\"anchor\"]<\/code> \u2014 Dynamically shows Login or Logout link depending on user state.<\/li>\n<li><code>[anys type=\"link\" name=\"auth\" format=\"anchor\" label_logged_in=\"Sign Out\" label_logged_out=\"Sign In\"]<\/code> \u2014 Customizes labels for both states.<\/li>\n<\/ul>\n\n<p>Attributes supported:\n- <code>name<\/code>: The link type (e.g., <code>logout<\/code>, <code>login<\/code>, <code>home<\/code>, <code>admin<\/code>, etc.).\n- <code>redirect<\/code>: Optional redirect URL (used for login\/logout links).\n- <code>format<\/code>: Either <code>url<\/code> (default) or <code>anchor<\/code> for clickable links.\n- <code>target<\/code>: Optional anchor target (e.g., <code>_blank<\/code>).\n- <code>label<\/code>: Optional link text (default varies by type).\n- <code>label_logged_in<\/code>: Custom label when the user is logged in (used with <code>auth<\/code>).\n- <code>label_logged_out<\/code>: Custom label when the user is logged out (used with <code>auth<\/code>).\n- <code>id<\/code>: Used for post and term links.<\/p>\n\n<p><strong>Option<\/strong>\nRetrieve WordPress option values.<\/p>\n\n<p>Examples:<\/p>\n\n<ul>\n<li><code>[anys type=\"option\" name=\"blogname\"]<\/code> \u2014 Shows site title.<\/li>\n<li><code>[anys type=\"option\" name=\"admin_email\"]<\/code> \u2014 Shows site admin email.<\/li>\n<\/ul>\n\n<p><strong>Function<\/strong>\nExecute a whitelisted PHP function and optionally pass arguments.<\/p>\n\n<p>Examples:<\/p>\n\n<ul>\n<li><code>[anys type=\"function\" name=\"date_i18n, F j, Y\"]<\/code> \u2014 Shows today\u2019s date.<\/li>\n<li><code>[anys type=\"function\" name=\"sanitize_text_field, (anys type='option' name='blogdescription')\"]<\/code> \u2014 Sanitizes and shows site description.<\/li>\n<li><code>[anys type=\"function\" name=\"date_i18n, F j, Y\" before=\"Today is \"]<\/code> \u2014 Shows today\u2019s date with custom prefix.<\/li>\n<li><code>[anys type=\"function\" name=\"date_i18n, F j, Y\" after=\".\"]<\/code> \u2014 Shows today\u2019s date with custom suffix.<\/li>\n<li><code>[anys type=\"function\" name=\"my_custom_function\" fallback=\"N\/A\"]<\/code> \u2014 Shows output of custom function or fallback.<\/li>\n<li><code>[anys type=\"function\" name=\"my_custom_function\" format=\"capitalize\"]<\/code> \u2014 Shows output of custom function and automatically capitalizes the output (e.g., \"hello world\" \u2192 \"Hello World\").<\/li>\n<li><code>[anys type=\"function\" name=\"my_custom_function\" delimiter=\", \"]<\/code> \u2014 Shows output of custom function. If the function returns an array, the values are joined using the given delimiter (e.g., <code>[\"apple\", \"banana\"]<\/code> \u2192 \"apple, banana\").<\/li>\n<\/ul>\n\n<p>Notes:\n- Only functions whitelisted in plugin settings can be executed.\n- Arguments can include other <code>[anys]<\/code> shortcodes using <code>()<\/code> instead of <code>[]<\/code>.\n- Output can be formatted or wrapped with <code>before<\/code>\/<code>after<\/code> content and fallback.<\/p>\n\n<h3>Dynamic Attribute Parsing<\/h3>\n\n<p>Supports dynamic placeholders inside attribute values:\n- <code>{get:param}<\/code> \u2014 gets value from $_GET['param']\n- <code>{post:param}<\/code> \u2014 gets value from $_POST['param']\n- <code>{func:function_name,arg1,arg2}<\/code> \u2014 calls a whitelisted PHP function\n- <code>{shortcode:(tag)}<\/code> \u2014 parses nested shortcode (use <code>()<\/code> instead of <code>[]<\/code>)\n- <code>{const:CONSTANT_NAME}<\/code> \u2014 replaces with PHP constant value<\/p>\n\n<p>Example:\n    <code>[anys type=\"post_field\" name=\"post_title\" id=\"{get:post_id}\" before=\"Title: \"]<\/code><\/p>\n\n<h3>Formatting Options<\/h3>\n\n<ul>\n<li><code>date<\/code> \u2014 Format timestamps using WordPress date format.<\/li>\n<li><code>datetime<\/code> \u2014 Format timestamps using WordPress date and time format.<\/li>\n<li><code>number<\/code> \u2014 Localized number format.<\/li>\n<li><code>json<\/code> \u2014 Encode value as JSON string.<\/li>\n<li><code>serialize<\/code> \u2014 Serialize PHP value.<\/li>\n<li><code>unserialize<\/code> \u2014 Unserialize string if serialized.<\/li>\n<li><code>print_r<\/code> \u2014 Human-readable output of variable.<\/li>\n<li><code>var_export<\/code> \u2014 Parsable string representation.<\/li>\n<li><code>implode<\/code> \u2014 Join array values.<\/li>\n<li><code>values<\/code> \u2014 Join array values only.<\/li>\n<li><code>keys<\/code> \u2014 Join array keys only.<\/li>\n<li><code>keys_values<\/code> \u2014 Join array key-value pairs.<\/li>\n<li><code>capitalize<\/code> \u2014 Capitalize words.<\/li>\n<li><code>uppercase<\/code> \u2014 Uppercase all characters.<\/li>\n<li><code>lowercase<\/code> \u2014 Lowercase all characters.<\/li>\n<li><code>strip_tags<\/code> \u2014 Remove HTML\/PHP tags.<\/li>\n<\/ul>\n\n<p>Custom formats are supported via filters.<\/p>\n\n<h3>Hooks<\/h3>\n\n<p><strong>Filters<\/strong>\n- <code>anys\/attributes<\/code> \u2014 Filter attributes before processing.\n- <code>anys\/{type}\/attributes<\/code> \u2014 Filter attributes dynamically by type.\n- <code>anys\/output<\/code> \u2014 Filter final output.\n- <code>anys\/{type}\/output<\/code> \u2014 Filter output dynamically by type.\n- <code>anys\/link\/handlers<\/code> - Filter link handlers.<\/p>\n\n<p><strong>Actions<\/strong>\n- <code>anys\/output\/before<\/code> \u2014 Fires before output.\n- <code>anys\/{type}\/output\/before<\/code> \u2014 Fires before output for specific type.\n- <code>anys\/{type}\/missing<\/code> \u2014 Fires when handler file missing.\n- <code>anys\/output\/after<\/code> \u2014 Fires after output.\n- <code>anys\/{type}\/output\/after<\/code> \u2014 Fires after output for specific type.<\/p>\n\n<h3>Security<\/h3>\n\n<ul>\n<li>All inputs sanitized using WordPress functions.<\/li>\n<li>Function calls restricted to whitelisted list.<\/li>\n<li>Outputs sanitized with <code>wp_kses_post()<\/code>.<\/li>\n<li>Dynamic parsing uses caching for performance.<\/li>\n<\/ul>\n\n<h3>Support &amp; Contribution<\/h3>\n\n<p>For bugs, feature requests, or contributions, open an issue or PR on the <a href=\"https:\/\/github.com\/wpizard\/anything-shortcodes\">plugin repository<\/a>.<\/p>\n\n<p>Thank you for using Anything Shortcodes!<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin folder to <code>\/wp-content\/plugins\/<\/code>.<\/li>\n<li>Activate the plugin via the \"Plugins\" menu in WordPress.<\/li>\n<li>Use the <code>[anys]<\/code> shortcode anywhere you want.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='can%20i%20run%20php%20functions%20in%20attributes%3F'><h3>Can I run PHP functions in attributes?<\/h3><\/dt>\n<dd><p>Yes \u2014 use <code>{func:function_name(arguments)}<\/code> syntax in any attribute.<\/p><\/dd>\n<dt id='can%20i%20use%20url%20parameters%3F'><h3>Can I use URL parameters?<\/h3><\/dt>\n<dd><p>Yes \u2014 <code>{get:param_name}<\/code> will be replaced with the value from the query string.<\/p><\/dd>\n<dt id='is%20the%20output%20safe%3F'><h3>Is the output safe?<\/h3><\/dt>\n<dd><p>Yes \u2014 all values are escaped using <code>wp_kses_post()<\/code> by default.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.3.0 - 2025-10-07<\/h4>\n\n<ul>\n<li>Added Link type.<\/li>\n<\/ul>\n\n<h4>1.2.0 - 2025-09-29<\/h4>\n\n<ul>\n<li>Added Term Field type.<\/li>\n<\/ul>\n\n<h4>1.1.0 - 2025-08-15<\/h4>\n\n<ul>\n<li>Added Function type.<\/li>\n<li>Added Settings page.<\/li>\n<li>Added Whitelisted Functions setting for better security control.<\/li>\n<li>Added more formats (json, serialize, unserialize, print_r, var_export, implode, keys, capitalize, uppercase, lowercase, strip_tags, values, keys_values).<\/li>\n<li>Improved shortcode registration for future shortcodes.<\/li>\n<li>Improved hooks naming conventions.<\/li>\n<li>Improved docs.<\/li>\n<\/ul>\n\n<h4>1.0.0 - 2025-08-04<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<\/ul>","raw_excerpt":"Retrieve and display any WordPress data with shortcodes \u2014 posts, users, options, and more, with flexible formatting and customization.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/183427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=183427"}],"author":[{"embeddable":true,"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/wpizard"}],"wp:attachment":[{"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=183427"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=183427"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=183427"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=183427"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=183427"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=183427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}