Custom Global Variables
Custom Global Variables
Description
Create your own custom variables to manage information on your website such as:
- Phone numbers
- Addresses
- Social media links
- HTML snippets
- And anything else
test
Easily access them globally in WordPress and PHP.
Why you need it
Rather than having to change something like an email address across multiple pages, you can do it in one place. Avoid the pitfalls of hard coding information in your WordPress theme that is likely to change.
Why it’s better
- Your variables are stored and retrieved locally without any calls to the database. That means faster load times for your pages!
- Variables can be accessed easily in PHP from the global scope.
Usage
Display your variables using the shortcode syntax:
[cgv variable-name]
Or using the superglobal in PHP:
<?php echo $GLOBALS['cgv']['variable-name'] ?>
Installation
- Upload the plugin files to the
/wp-content/plugins/plugin-namedirectory, or install the plugin through the WordPress plugins screen directly. - Activate the plugin through the ‘Plugins’ screen in WordPress
- Use the
Settings -> Custom Global Variablesscreen to define your variables
Reviews
Thanks For This GREAT Plugin!!!
By (bhetzman) on June 5, 2022
The best custom shortcode plugin for agencies!
By Seb Fontan (sebfontan) on March 7, 2022
Exactly what I was looking for.
By Leona (wp-leona) on May 26, 2017
Simply, smart and free !
By Tony88 on May 11, 2017
Just what i needed, thanks!
By wzshop on April 3, 2017
Easy to use! Easy and simple! Wonderful!
By ppp2017 on February 8, 2017
Just what I needed!
By diegobia (DiegoBia) on December 28, 2016
Best of the ones I tested
By janzeman on September 3, 2016
By far the best one "Variables" plugin. I tested some others, those were based on database and because of failed caching I experienced problems. Since the day I moved to this plugin, all problems disappeared 🙂 I love the simplicity 🙂
Does what it needs to do
By rw24 on September 3, 2016
Exactly what I needed. Plain and simple.
Easy to use
By mickaelsery on September 3, 2016
Simple and powerful, just what I was looking for
Changelog
1.1.2
- Updated to be able to use markups in value fields.
1.1.1
- This is a security and maintenance release and we strongly encourage you to update to it immediately.
1.1.0
- This is a security and maintenance release and we strongly encourage you to update to it immediately.
1.0.5
- Updated accreditation
- Updated stylesheet
- Tested up to WordPress 5.1
1.0.4
- Fixed folder path in error message
1.0.3
- Changed file path to where variables are stored
1.0.2
- Support for older versions of PHP that handle object referencing differently
1.0.1
- Support for older versions of PHP (< 5.4) that do not allow the short array syntax
