wp/wp-admin/includes/class-wp-upgrader-skin.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
--- a/wp/wp-admin/includes/class-wp-upgrader-skin.php	Tue Oct 22 16:11:46 2019 +0200
+++ b/wp/wp-admin/includes/class-wp-upgrader-skin.php	Tue Dec 15 13:49:49 2020 +0100
@@ -15,21 +15,60 @@
  */
 class WP_Upgrader_Skin {
 
+	/**
+	 * Holds the upgrader data.
+	 *
+	 * @since 2.8.0
+	 *
+	 * @var object
+	 */
 	public $upgrader;
+
+	/**
+	 * Whether header is done.
+	 *
+	 * @since 2.8.0
+	 *
+	 * @var bool
+	 */
 	public $done_header = false;
+
+	/**
+	 * Whether footer is done.
+	 *
+	 * @since 2.8.0
+	 *
+	 * @var bool
+	 */
 	public $done_footer = false;
 
 	/**
 	 * Holds the result of an upgrade.
 	 *
 	 * @since 2.8.0
+	 *
 	 * @var string|bool|WP_Error
 	 */
-	public $result  = false;
+	public $result = false;
+
+	/**
+	 * Holds the options of an upgrade.
+	 *
+	 * @since 2.8.0
+	 *
+	 * @var array
+	 */
 	public $options = array();
 
 	/**
-	 * @param array $args
+	 * Constructor.
+	 *
+	 * Sets up the generic skin for the WordPress Upgrader classes.
+	 *
+	 * @since 2.8.0
+	 *
+	 * @param array $args Optional. The WordPress upgrader skin arguments to
+	 *                    override default options. Default empty array.
 	 */
 	public function __construct( $args = array() ) {
 		$defaults      = array(
@@ -76,12 +115,12 @@
 	 *
 	 * @see request_filesystem_credentials()
 	 *
-	 * @param bool   $error                        Optional. Whether the current request has failed to connect.
-	 *                                             Default false.
-	 * @param string $context                      Optional. Full path to the directory that is tested
-	 *                                             for being writable. Default empty.
-	 * @param bool   $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.
-	 * @return bool False on failure, true on success.
+	 * @param bool|WP_Error $error                        Optional. Whether the current request has failed to connect,
+	 *                                                    or an error object. Default false.
+	 * @param string        $context                      Optional. Full path to the directory that is tested
+	 *                                                    for being writable. Default empty.
+	 * @param bool          $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.
+	 * @return bool True on success, false on failure.
 	 */
 	public function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) {
 		$url = $this->options['url'];
@@ -140,15 +179,14 @@
 
 	/**
 	 * @param string $string
+	 * @param mixed  ...$args Optional text replacements.
 	 */
-	public function feedback( $string ) {
+	public function feedback( $string, ...$args ) {
 		if ( isset( $this->upgrader->strings[ $string ] ) ) {
 			$string = $this->upgrader->strings[ $string ];
 		}
 
 		if ( strpos( $string, '%' ) !== false ) {
-			$args = func_get_args();
-			$args = array_splice( $args, 1 );
 			if ( $args ) {
 				$args   = array_map( 'strip_tags', $args );
 				$args   = array_map( 'esc_html', $args );
@@ -162,10 +200,16 @@
 	}
 
 	/**
+	 * Action to perform before an update.
+	 *
+	 * @since 2.8.0
 	 */
 	public function before() {}
 
 	/**
+	 * Action to perform following an update.
+	 *
+	 * @since 2.8.0
 	 */
 	public function after() {}
 
@@ -206,4 +250,16 @@
 	/**
 	 */
 	public function bulk_footer() {}
+
+	/**
+	 * Hides the `process_failed` error message when updating by uploading a zip file.
+	 *
+	 * @since 5.5.0
+	 *
+	 * @param WP_Error $wp_error WP_Error
+	 * @return bool
+	 */
+	public function hide_process_failed( $wp_error ) {
+		return false;
+	}
 }