| 开发者 | iamsufyanikram |
|---|---|
| 更新时间 | 2026年10月10日 18:20 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
phone_number with your phone number as the value.[gvmgr key="phone_number"] anywhere you can write content.tel:, wa.me or mailto: by hand:
tel: link.wa.me link (with an optional pre-filled message) and a readable number.mailto: link.[gvmgr key="your_key"].gvmgr_get_variable( 'your_key' ).country_code (for example 1 for the USA) and set it once.sufilabs-global-variables-manager folder to /wp-content/plugins/ and activate it on the Plugins screen.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.
In a theme file, use <?php echo gvmgr_get_variable( 'phone_number' ); ?>. The value is already escaped, so it is safe to echo directly.
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.
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.
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.
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.
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.
The shortcode works in the Shortcode block, in Paragraph blocks and in most text areas that process shortcodes. There is no dedicated block.
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.
The shortcode simply prints nothing. Nothing breaks, but the text will be missing until you add the variable back.
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.
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.
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.
Yes. Each site has its own variables, managed by that site's administrators.
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.