跳到内容

Custom Global Variables

v1.1.4

oden7777 · 2016年4月7日 上架

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

正在使用
5,000+
评分
5.0 / 5
累计下载
3 万
最近更新
2026年11月2日
10 条评价需要 WordPress 3.0.1+已测试到 7.1.5PHP 5.6+

截图

Settings -> Custom Global Variables
Settings -> Custom Global Variables

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

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums