diff --git a/inc/class-command.php b/inc/class-command.php index c008c40..3ba8f0c 100644 --- a/inc/class-command.php +++ b/inc/class-command.php @@ -304,7 +304,9 @@ class Command { $this->filter_depth = 1; } - WP_CLI::add_wp_hook( $current_filter, array( $this, 'wp_hook_end' ), 9999 ); + if ( 'shutdown' !== $this->focus_hook ) { + WP_CLI::add_wp_hook( $current_filter, array( $this, 'wp_hook_end' ), 9999 ); + } } /**