Linux 软件免费装
Banner图

SufiLabs Global Variables Manager

开发者 iamsufyanikram
更新时间 2026年10月10日 18:20
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

shortcode elementor dynamic content phone number global variables

下载

1.3.1

详情介绍:

Have you ever changed your phone number and then had to hunt through twenty pages to update it? Global Variables Manager fixes that. You type each piece of information once, on one screen. Everywhere that information appears on your site updates by itself. How it works
  1. Go to Global Variables in the WordPress admin menu.
  2. Add a variable, for example the key phone_number with your phone number as the value.
  3. Put [gvmgr key="phone_number"] anywhere you can write content.
That is all. Change the value later and every page follows. Links are built for you Phone, WhatsApp, email and address variables also create ready-made links automatically, so you never type tel:, wa.me or mailto: by hand: These are never stored. They are worked out from the value you saved, so there is only ever one place to change. Features Good to know

安装:

  1. In WordPress, go to Plugins → Add New and search for "SufiLabs Global Variables Manager".
  2. Click Install Now, then Activate.
  3. Open Global Variables in the admin menu.
  4. Fill in the starter variables (site name, address, phone, WhatsApp, email) or add your own, then click Save Changes.
Manual install: upload the sufilabs-global-variables-manager folder to /wp-content/plugins/ and activate it on the Plugins screen.

屏幕截图:

  • The Add a variable form and the optional uninstall setting.
  • The Built automatically table showing generated phone, WhatsApp, email and map links, and the How to use section.

升级注意事项:

1.3.1 All names now use the unique prefix gvmgr, including the shortcode [gvmgr key="..."]. 1.3.0 Adds an uninstall data option and translation support. Your saved variables are kept as they are.

常见问题:

How do I show a variable on a page?

Add the shortcode where you want it, for example [gvmgr key="phone_number"]. The key is shown in the Shortcode column of the Global Variables screen.

How do I use a variable in my theme?

In a theme file, use <?php echo gvmgr_get_variable( 'phone_number' ); ?>. The value is already escaped, so it is safe to echo directly.

How do I make a clickable phone number?

Set the variable's type to Phone. Then, in an Elementor Link field, click the dynamic tags icon, choose Site → Global Variable and pick the "(auto)" entry for the phone link. In a theme file, use <a href="<?php echo esc_url( gvmgr_get_variable( 'phone_number_link' ) ); ?>">. Shortcodes are not reliably processed inside link fields of the block editor, so the shortcode is best for visible text.

What keys are generated automatically?

For a variable with the key phone_number, the plugin creates phone_number_e164 and phone_number_link. WhatsApp creates _link and _display. Email creates _link. Address creates _one_line, _maps_link and _directions_link. The Built automatically table on the settings screen lists every one with its current value.

Can I pre-fill a WhatsApp message?

Yes. Create a variable with the key whatsapp_message (a Textarea works well). It is added to the WhatsApp link. To use a different message for one number, create a variable named after that number's key with _message on the end, for example sales_whatsapp_message for sales_whatsapp.

My phone number link has the wrong country code.

Numbers without a country code are assumed to be UK (+44). Add a variable with the key country_code and a value such as 1 or 61. You can also type the number with a plus sign, such as +1 555 010 9999, and it is used as it is.

Does it work with Elementor?

Yes. On a text field or a Link field, click the dynamic tags icon and choose Site → Global Variable, then pick the variable. Elementor is not required. Without it the plugin still works with shortcodes and PHP.

Does it work with the block editor and block themes?

The shortcode works in the Shortcode block, in Paragraph blocks and in most text areas that process shortcodes. There is no dedicated block.

Why does my shortcode show nothing?

The key does not exist (check spelling and that it is lowercase), or the value is empty. A missing key prints nothing rather than an error.

What happens if I delete a variable that is used on my pages?

The shortcode simply prints nothing. Nothing breaks, but the text will be missing until you add the variable back.

Can I put HTML in a variable?

No. Values are stored as plain text and shown as plain text, so HTML tags do not work. Textarea and Address values keep their line breaks.

Is it safe to store secrets such as API keys?

No. Visitors can see any variable that is shown on a page, and anyone who can write posts can print any variable using the shortcode. Use it for public information only.

What happens to my data if I uninstall it?

By default nothing is deleted. To remove everything when you delete the plugin, tick Delete all variables and settings when the plugin is deleted on the settings screen and save before deleting.

Does it work on multisite?

Yes. Each site has its own variables, managed by that site's administrators.

Does it slow my site down?

No. Variables live in one WordPress option that is loaded with the rest of your settings, and the plugin makes no extra database queries or web requests.

更新日志:

1.3.1 1.3.0