upgrader->strings[ $error ] ) ) { $error = $this->upgrader->strings[ $error ]; } // TODO: show all errors, not just the first one WP_CLI::warning( $error ); } /** * @param string $string * @param mixed ...$args Optional text replacements. */ public function feedback( $string, ...$args ) { $args_array = []; foreach ( $args as $arg ) { $args_array[] = $args; } $this->process_feedback( $string, $args ); } /** * Process the feedback collected through the compat indirection. * * @param string $string String to use as feedback message. * @param array $args Array of additional arguments to process. */ public function process_feedback( $string, $args ) { if ( 'parent_theme_prepare_install' === $string ) { WP_CLI::get_http_cache_manager()->whitelist_package( $this->api->download_link, 'theme', $this->api->slug, $this->api->version ); } if ( isset( $this->upgrader->strings[ $string ] ) ) { $string = $this->upgrader->strings[ $string ]; } if ( ! empty( $args ) && strpos( $string, '%' ) !== false ) { $string = vsprintf( $string, $args ); } if ( empty( $string ) ) { return; } $string = str_replace( '…', '...', Utils\strip_tags( $string ) ); $string = html_entity_decode( $string, ENT_QUOTES, get_bloginfo( 'charset' ) ); WP_CLI::log( $string ); } }