该插件尚未通过WordPress的最新3个主要版本进行测试。 当与较新版本的WordPress一起使用时,可能不再受到维护或支持,并且可能会存在兼容性问题。

dotenv

描述

Any WPENV_ prefixed variables in the .env will be used to override the WordPress options. For example, if you’d like to set a specific environment to “Discourage search engines from indexing this site”, you can add WPENV_BLOG_PUBLIC=0 to your .env file.

  • Any option in the wp_options table or retrieved by get_option() can be set this way.

  • You can define keys either as WPENV_BLOGDESCRIPTION or as WPENV_blogdescription, both will work.

  • If you’d like to define the location of your .env file, rather than the plugin looking for it, you can filter dotenv_location to be a directory path.

  • You can also change the WPENV_ prefix by filtering dotev_key_prefix to be a different prefix.

安装

  • Install the plugin.
    • Add a .env file either in the root of your site or one level above.
    • Add any WordPress options keys to filter with the prefix WPENV_

评价

此插件暂无评价。

贡献者及开发者

“dotenv” 是开源软件。 以下人员对此插件做出了贡献。

贡献者

「dotenv」插件已被翻译至 1 种本地化语言。 感谢所有译者为本插件所做的贡献。

将“dotenv”翻译成您的语言。

对开发感兴趣吗?

您可以浏览代码,查看SVN仓库,或通过RSS订阅开发日志