Skip to content

Commit 0c0995f

Browse files
committed
change to switch, add option for windows systems
1 parent e8e2582 commit 0c0995f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

admin-command.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@
88
* Open /wp-admin/ in a browser.
99
*/
1010
$wp_admin = function() {
11-
$exec = 'xdg-open';
12-
if ( 'DAR' === strtoupper( substr( PHP_OS, 0, 3 ) ) ) {
13-
$exec = 'open';
11+
switch ( strtoupper( substr( PHP_OS, 0, 3 ) ) ) {
12+
case 'DAR':
13+
$exec = 'open';
14+
break;
15+
case 'WIN':
16+
$exec = 'start ""';
17+
break;
18+
default:
19+
$exec = 'xdg-open';
1420
}
1521
passthru( $exec . ' ' . escapeshellarg( admin_url() ) );
1622
};

0 commit comments

Comments
 (0)