plugin-icon

Custom Global Variables

投稿者: akirak·
Easily create custom variables that can be accessed globally in Wordpress and PHP. Retrieval of information is extremely fast, with no database calls.
評価
5/5
バージョン
1.1.2
有効インストール数
6K
最終更新日時
Mar 22, 2023
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.

使用法

Display your variables using the shortcode syntax:

[cgv variable-name]

Or using the superglobal in PHP:

<?php echo $GLOBALS['cgv']['variable-name'] ?>
無料Business プランを利用中
インストールすることで、WordPress.com の利用規約サードパーティプラグイン利用規約に同意したことになります。
最大テスト回数
WordPress 6.1.9
このプラグインをダウンロードして、 サイトに使用できます。