diff --git a/inc/class-command.php b/inc/class-command.php index 6db8dc7..ffef001 100644 --- a/inc/class-command.php +++ b/inc/class-command.php @@ -267,11 +267,13 @@ class Command { * Run the profiler against WordPress */ private function run_profiler() { - if ( ! isset( WP_CLI::get_runner()->config['url'] ) ) { - WP_CLI::add_wp_hook( 'muplugins_loaded', function(){ + WP_CLI::add_wp_hook( 'muplugins_loaded', function(){ + if ( $url = WP_CLI::get_runner()->config['url'] ) { + WP_CLI::set_url( trailingslashit( $url ) ); + } else { WP_CLI::set_url( home_url( '/' ) ); - }); - } + } + }); WP_CLI::add_hook( 'after_wp_config_load', function() { if ( defined( 'SAVEQUERIES' ) && ! SAVEQUERIES ) { WP_CLI::error( "'SAVEQUERIES' is defined as false, and must be true. Please check your wp-config.php" );