Custom Global Variables

plugin banner

Easily create custom variables that can be accessed globally in WordPress and PHP. Retrieval of information is extremely fast, with no database calls.

Author:new target, inc (profile at wordpress.org)
WordPress version required:3.0.1
WordPress version tested:6.1.1
Plugin version:1.1.2
Added to WordPress repository:07-04-2016
Last updated:22-03-2023
Rating, %:100
Rated by:10
Plugin URI:https://www.newtarget.com/solutions/wordpress...
Total downloads:16 795
Active installs:6 000+
plugin download
Click to start download

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'] ?>

Screenshots
ChangeLog