{"id":360757,"date":"2026-08-30T21:15:17","date_gmt":"2026-08-30T21:15:17","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/primo-vars\/"},"modified":"2026-08-30T21:15:10","modified_gmt":"2026-08-30T21:15:10","slug":"primo-vars","status":"publish","type":"plugin","link":"https:\/\/li.wordpress.org\/plugins\/primo-vars\/","author":7552386,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.0","stable_tag":"1.0.0","tested":"7.1","requires":"6.3","requires_php":"7.4","requires_plugins":null,"header_name":"Primo Vars","header_author":"Primo","header_description":"Your phone number, email address and social links, defined once on one settings screen and output anywhere with a shortcode or block. Manage them under Settings &rarr; Primo Vars.","assets_banners_color":"13bda0","last_updated":"2026-08-30 21:15:10","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/primowp.com\/primo-vars\/","header_author_uri":"https:\/\/primowp.com\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":54,"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":"zurtri","date":"2026-08-30 21:15:10","revision":3673131}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3673130,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3673130,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3673130,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3673130,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":{"primo-vars\/var":{"$schema":"https:\/\/schemas.wp.org\/trunk\/block.json","apiVersion":3,"name":"primo-vars\/var","title":"Primo Var","category":"text","icon":"editor-code","description":"Output a variable defined under Settings, Primo Vars.","keywords":["variable","shortcode","phone","email","address"],"textdomain":"primo-vars","supports":{"html":false,"reusable":true,"className":false,"customClassName":false},"attributes":{"key":{"type":"string","default":""},"raw":{"type":"boolean","default":false},"text":{"type":"string","default":""}},"editorScript":"file:.\/editor.js","editorStyle":"file:.\/editor.css"}},"tagged_versions":["1.0.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3673130,"resolution":"1","location":"assets","locale":"","width":1280,"height":960},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3673130,"resolution":"2","location":"assets","locale":"","width":1280,"height":960},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3673130,"resolution":"3","location":"assets","locale":"","width":1280,"height":960}},"screenshots":{"1":"The Primo Vars settings screen.","2":"The Primo Var block in the editor.","3":"Contact details rendered on the front end."}},"plugin_section":[],"plugin_tags":[220634,267,2644,80,2276],"plugin_category":[41,43],"plugin_contributors":[274746],"plugin_business_model":[],"class_list":["post-360757","plugin","type-plugin","status-publish","hentry","plugin_tags-contact-details","plugin_tags-email","plugin_tags-phone","plugin_tags-shortcode","plugin_tags-variables","plugin_category-communication","plugin_category-customization","plugin_contributors-zurtri","plugin_committers-zurtri"],"banners":{"banner":"https:\/\/ps.w.org\/primo-vars\/assets\/banner-772x250.png?rev=3673130","banner_2x":"https:\/\/ps.w.org\/primo-vars\/assets\/banner-1544x500.png?rev=3673130","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/primo-vars\/assets\/icon-128x128.png?rev=3673130","icon_2x":"https:\/\/ps.w.org\/primo-vars\/assets\/icon-256x256.png?rev=3673130","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/primo-vars\/assets\/screenshot-1.png?rev=3673130","caption":"The Primo Vars settings screen."},{"src":"https:\/\/ps.w.org\/primo-vars\/assets\/screenshot-2.png?rev=3673130","caption":"The Primo Var block in the editor."},{"src":"https:\/\/ps.w.org\/primo-vars\/assets\/screenshot-3.png?rev=3673130","caption":"Contact details rendered on the front end."}],"raw_content":"<!--section=description-->\n<p>Contact details have a habit of appearing on a dozen pages. When the phone number or email changes, you get to find every one of them - a real pain!<\/p>\n\n<p>Primo Vars fixes that. Define a value once on a single settings screen, give it a name, and use its shortcode wherever you need it. Change the value and every page follows.<\/p>\n\n<p>Each variable has a <strong>type<\/strong>, and the type does the fiddly work for you:<\/p>\n\n<ul>\n<li><strong>Phone<\/strong>: renders a tappable <code>tel:<\/code> link, while displaying the number exactly as you typed it, brackets, spaces, country code and all.<\/li>\n<li><strong>Email<\/strong>: renders a <code>mailto:<\/code> link with the address obfuscated against scrapers.<\/li>\n<li><strong>Link<\/strong>: renders an anchor, with an optional custom label.<\/li>\n<li><strong>Address<\/strong>: a multi-line field that keeps your line breaks.<\/li>\n<li><strong>Multi-line text<\/strong>: the same, for opening hours, a disclaimer, anything that runs to more than one line.<\/li>\n<li><strong>Text<\/strong>: renders plain text, for anything else.<\/li>\n<\/ul>\n\n<h4>Usage<\/h4>\n\n<pre><code>[primo_var key=\"phone\"]\n[primo_var key=\"email\"]\n[primo_var key=\"facebook\" text=\"Follow us\"]\n[primo_var key=\"phone\" raw=\"1\"]\n\nraw=\"1\" returns the plain value with no link, for when you are building your own markup around it.\n<\/code><\/pre>\n\n<p>In a theme template:<\/p>\n\n<pre><code>&lt;?php echo primo_vars_get( 'phone' ); ?&gt;\n&lt;?php echo primo_vars_get( 'phone', true ); \/\/ raw ?&gt;\n<\/code><\/pre>\n\n<h4>In the block editor<\/h4>\n\n<p>Insert the <strong>Primo Var<\/strong> block, pick a variable from the dropdown, and it\nrenders exactly what the shortcode would. Use the shortcode when you want a\nvalue inline in a sentence, and the block when it stands on its own.<\/p>\n\n<h4>Starter variables<\/h4>\n\n<p>A fresh install creates seven empty variables to fill in: phone, email,\naddress, facebook, instagram, linkedin and youtube. Delete the ones you do not\nwant, or add your own. A YouTube channel is just a Link, the same as any other\nsocial profile.<\/p>\n\n<h4>For developers<\/h4>\n\n<p>Filter <code>primo_vars_output<\/code> to change what any variable renders, from the\nshortcode, the block and <code>primo_vars_get()<\/code> alike. It fires for a variable\nthat is defined but left empty, which is what the example below relies on;\nit does not fire for a key that is not defined at all, since all three entry\npoints return an empty string before reaching this filter in that case.<\/p>\n\n<pre><code>add_filter( 'primo_vars_output', function ( $html, $var, $atts ) {\n    if ( '' === $html &amp;&amp; 'phone' === $var['type'] ) {\n        return 'Call the office';\n    }\n    return $html;\n}, 10, 3 );\n<\/code><\/pre>\n\n<p>The HTML handed to the filter is already escaped. Anything your callback adds\nis yours to escape.<\/p>\n\n<h4>Phone numbers with extra text<\/h4>\n\n<p>Real phone numbers are messy. <code>+61 491 570 156 Option 2<\/code> and <code>(08) 8123 1234<\/code> both display exactly as typed, and both produce a correct dial link. The trailing \"Option 2\" is not dialled.<\/p>\n\n<p>Where the number cannot be worked out automatically, no link is shown rather than a wrong one. That covers vanity numbers like <code>1300 PRIMO<\/code>, and two numbers written in one field such as <code>(08) 8123 1234 (0412 345 678)<\/code>. Fill in the optional <strong>Dial as<\/strong> field on that row and it will link exactly as you specify.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin to <code>\/wp-content\/plugins\/<\/code> and activate it.<\/li>\n<li>Go to <strong>Settings \u2192 Primo Vars<\/strong>.<\/li>\n<li>Fill in the values for the starter variables, or add your own.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"what%20happens%20if%20i%20use%20a%20shortcode%20for%20a%20variable%20i%20have%20not%20filled%20in%3F\"><h3>What happens if I use a shortcode for a variable I have not filled in?<\/h3><\/dt>\n<dd><p>Nothing renders. Visitors never see a placeholder or an error message.<\/p><\/dd>\n<dt id=\"why%20was%20my%20web%20address%20rejected%3F\"><h3>Why was my web address rejected?<\/h3><\/dt>\n<dd><p>A link needs its scheme, so use <code>https:\/\/facebook.com\/you<\/code> rather than <code>facebook.com\/you<\/code>. The plugin tells you which variable it refused and leaves the old value in place rather than saving something that would not work.<\/p><\/dd>\n<dt id=\"does%20this%20work%20in%20widgets%3F\"><h3>Does this work in widgets?<\/h3><\/dt>\n<dd><p>Yes. Widget areas have been block-based since WordPress 5.8, so add the Primo\nVar block, or a Shortcode block holding <code>[primo_var]<\/code>, to any widget area or\nsite editor template.<\/p>\n\n<p>Navigation menu labels are the exception: WordPress does not run shortcodes\nthere, and this plugin deliberately does not add a filter to make it, because\nbroad <code>do_shortcode()<\/code> filters widen the injection surface for everyone.<\/p><\/dd>\n<dt id=\"does%20it%20phone%20home%3F\"><h3>Does it phone home?<\/h3><\/dt>\n<dd><p>No. No external requests, no tracking.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>First release.<\/li>\n<\/ul>","raw_excerpt":"Your phone number, email address and social links, defined once on one settings screen and output anywhere with a shortcode or block.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/360757","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=360757"}],"author":[{"embeddable":true,"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/zurtri"}],"wp:attachment":[{"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=360757"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=360757"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=360757"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=360757"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=360757"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=360757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}