| 开发者 |
edwardbock
palasthotel janaeggebrecht |
|---|---|
| 更新时间 | 2026年11月23日 22:24 |
| 捐献地址: | 去捐款 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPL-3.0-or-later |
| 版权网址: | 版权信息 |
environment-info.zip under Plugins > Add New > Upload Pluginwp-config.php, see belowDefine the constant ENVIRONMENT_INFO_SETTINGS in wp-config.php, with one entry per environment:
define( 'ENVIRONMENT_INFO_SETTINGS', [ [ 'path' => '/var/www/staging', 'title' => 'Staging', 'background' => '#b45309', 'color' => 'white' ], [ 'hostname' => 'web-prod-1', 'title' => 'Production', 'background' => '#b91c1c', 'color' => 'white' ], ] );
Each entry needs a title and is recognised either by hostname, compared with the server's host name, or by path, which matches when it appears anywhere in the plugin's directory path. background and color take any CSS colour.
Exactly one entry has to match. With none, or with more than one, the label reads "Unknown Server"; more than one match is also written to the error log. Tools > Environment Info lists every entry, marks the active one and shows the current host name and path, so you can see why nothing matched.
Every logged-in user who sees the admin bar. The overview under Tools > Environment Info requires the manage_options capability.