File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 33Plugin Name: Stage Switcher
44Plugin URI: http://roots.io/plugins/stage-switcher/
55Description: A WordPress plugin that allows you to switch between different environments from the admin bar.
6- Version: 1.0.0
6+ Version: 1.0.1
77Author: Ben Word
88Author URI: http://roots.io/
99License: MIT License
10+ GitHub Plugin URI: https://github.com/roots/wp-stage-switcher
1011*/
1112
1213namespace Roots \Bedrock ;
@@ -41,12 +42,14 @@ function admin_bar_stage_switcher($admin_bar) {
4142 'href ' => '# '
4243 ));
4344
45+ $ protocol = ((!empty ($ _SERVER ['HTTPS ' ]) && $ _SERVER ['HTTPS ' ] !== 'off ' ) || $ _SERVER ['SERVER_PORT ' ] == 443 ) ? 'https:// ' : 'http:// ' ;
46+
4447 foreach ($ stages as $ stage => $ url ) {
4548 if ($ stage === $ current_stage ) {
4649 continue ;
4750 }
4851
49- $ url .= $ _SERVER ['REQUEST_URI ' ];
52+ $ url .= str_replace ( $ stages [ $ current_stage ], '' , $ protocol . $ _SERVER ['HTTP_HOST ' ] . $ _SERVER [ ' REQUEST_URI ' ]) ;
5053
5154 $ admin_bar ->add_menu (array (
5255 'id ' => $ stage ,
You can’t perform that action at this time.
0 commit comments