From a75c346e6c4fc72b6344ece80fc888eb2f92d922 Mon Sep 17 00:00:00 2001 From: Mohammad Jangda <batmoo@gmail.com> Date: Thu, 11 Apr 2013 18:57:32 -0400 Subject: [PATCH] Prevent verbosity from being triggered multiple times if we loop through a command a few times. --- includes/class-wp-cli.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/class-wp-cli.php b/includes/class-wp-cli.php index 92f3bfd..f2ff59b 100644 --- a/includes/class-wp-cli.php +++ b/includes/class-wp-cli.php @@ -3,6 +3,7 @@ WP_CLI::add_command( 'syndication', 'Syndication_CLI_Command' ); class Syndication_CLI_Command extends WP_CLI_Command { + var $enabled_verbosity = false; function pull_site( $args, $assoc_args ) { $assoc_args = wp_parse_args( $assoc_args, array( @@ -42,6 +43,11 @@ var_dump( $site_id, $site ); } private function _make_em_talk_pull() { + if ( $this->enabled_verbosity ) + return; + + $this->enabled_verbosity = true; + // output when a post is new or updated add_filter( 'syn_pre_pull_posts', function( $posts, $site, $client ) { WP_CLI::line( sprintf( 'Processing feed %s (%d)', $site->post_title, $site->ID ) ); -- GitLab