[wordpress插件] Custom Global Variables自定义全局变量

wordpress 插件 文章 2020-04-08 09:00 957 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

Create your own custom variables to manage information on your website such as:

创建自己的自定义变量来管理您网站上的信息,例如:

    • Phone numbers
    • 电话号码

    • Addresses
    • 地址

    • Social media links
    • 社交媒体链接

    • HTML snippets
    • HTML片段

    • And anything else
    • 还有其他

    Easily access them globally in WordPress and PHP.

    在WordPress和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.

    避免可能会更改WordPress主题中的硬编码信息的陷阱。

    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.
      • 可以在PHP中轻松地从全局范围访问变量。

      Usage

      用法

      Display your variables using the shortcode syntax:

      使用简码语法显示变量:

      [cgv variable-name]

        [cgv变量名称]

      Or using the superglobal in PHP:

      或在PHP中使用超全局变量:

        <?php echo $ GLOBALS ['cgv'] ['variable-name']?>

安装步骤

    1. Upload the plugin files to the /wp-content/plugins/plugin-name directory, or install the plugin through the WordPress plugins screen directly.
    2. 将插件文件上传到 / wp-content / plugins / plugin-name 目录,或直接通过WordPress插件屏幕安装插件。

    3. Activate the plugin through the ‘Plugins’ screen in WordPress
    4. 通过WordPress中的“插件”屏幕激活插件

    5. Use the Settings -> Custom Global Variables screen to define your variables
    6. 使用 Settings-> Custom Global Variables 屏幕定义变量

下载地址
https://downloads.wordpress.org/plugin/custom-global-variables.zip
-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
[wordpress插件] WordPress Download ManagerWordPress下载管理器
[wordpress插件] BuddyForms WooCommerce Simple AuctionBuddyForms WooCommerce简单拍卖
[wordpress插件] Cliengo &#8211; Free ChatbotCliengo –免费聊天机器人
[wordpress插件] CPT Template PathCPT模板路径
[wordpress插件] Custom Login Error Message自定义登录错误消息
随便看看
小程序测试号解绑之后,扫一扫小程序登录又回来了 2101
微信公众号openid? 2347
微信开放平台跟公众平台有什么区别? 3608
怎么添加小程序支付功能? 4516
教育科技公司申请微信支付被拒绝? 4798
微信公众号免300认证教程 5892
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 5299
小程序广告组件通过审核,但是小程序内没有显示广告? 5067
企业微信通讯录账号被管理员误/恶意删除,怎么办? 9568
问题? 9048