Skip to content

Commit

Permalink
Define a function instead of a perceived global variable
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber committed Aug 30, 2023
1 parent 9dce0de commit 3f592b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions admin-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Open /wp-admin/ in a browser.
*/
$wp_admin = function() {
function wp_cli_admin_command() {
switch ( strtoupper( substr( PHP_OS, 0, 3 ) ) ) {
case 'DAR':
$exec = 'open';
Expand All @@ -19,5 +19,5 @@
$exec = 'xdg-open';
}
passthru( $exec . ' ' . escapeshellarg( admin_url() ) );
};
WP_CLI::add_command( 'admin', $wp_admin );
}
WP_CLI::add_command( 'admin', 'wp_cli_admin_command' );

0 comments on commit 3f592b0

Please sign in to comment.