
內容簡介
.env 檔案中任何以 WPENV_ 為前綴的變數都會被用於覆蓋 WordPress 選項。例如,如果您想要設定特定環境為 “阻止搜尋引擎索引這個網站”,您可以在.env 檔案中加入 WPENV_BLOG_PUBLIC=0。
所有在 wp_options 資料表中以及被 get_option() 取得的選項都可以透過此方式設定。
您可以定義鍵的方式為 WPENV_BLOGDESCRIPTION 或是 WPENV_blogdescription,兩者皆能有效。
如果您想要定義您的 .env 檔案位置,而不是由外掛來尋找,您可以過濾 dotenv_location 到一個目錄路徑。
您也可以過濾 dotev_key_prefix 以改變 WPENV_ 前綴。
外掛標籤
開發者團隊
原文外掛簡介
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.
