From ff802e8de97d06c16677b86e4c1ad39c7f891dfe Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Sat, 8 Oct 2016 05:56:25 -0700 Subject: [PATCH] WordPress doesn't like this last hook added to `shutdown` --- inc/class-command.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 ); + } } /**