wp/wp-admin/includes/class-wp-upgrader-skin.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
    18 	/**
    18 	/**
    19 	 * Holds the upgrader data.
    19 	 * Holds the upgrader data.
    20 	 *
    20 	 *
    21 	 * @since 2.8.0
    21 	 * @since 2.8.0
    22 	 *
    22 	 *
    23 	 * @var object
    23 	 * @var WP_Upgrader
    24 	 */
    24 	 */
    25 	public $upgrader;
    25 	public $upgrader;
    26 
    26 
    27 	/**
    27 	/**
    28 	 * Whether header is done.
    28 	 * Whether header is done.
    79 		);
    79 		);
    80 		$this->options = wp_parse_args( $args, $defaults );
    80 		$this->options = wp_parse_args( $args, $defaults );
    81 	}
    81 	}
    82 
    82 
    83 	/**
    83 	/**
       
    84 	 * @since 2.8.0
       
    85 	 *
    84 	 * @param WP_Upgrader $upgrader
    86 	 * @param WP_Upgrader $upgrader
    85 	 */
    87 	 */
    86 	public function set_upgrader( &$upgrader ) {
    88 	public function set_upgrader( &$upgrader ) {
    87 		if ( is_object( $upgrader ) ) {
    89 		if ( is_object( $upgrader ) ) {
    88 			$this->upgrader =& $upgrader;
    90 			$this->upgrader =& $upgrader;
    89 		}
    91 		}
    90 		$this->add_strings();
    92 		$this->add_strings();
    91 	}
    93 	}
    92 
    94 
    93 	/**
    95 	/**
       
    96 	 * @since 3.0.0
    94 	 */
    97 	 */
    95 	public function add_strings() {
    98 	public function add_strings() {
    96 	}
    99 	}
    97 
   100 
    98 	/**
   101 	/**
   135 
   138 
   136 		return request_filesystem_credentials( $url, '', $error, $context, $extra_fields, $allow_relaxed_file_ownership );
   139 		return request_filesystem_credentials( $url, '', $error, $context, $extra_fields, $allow_relaxed_file_ownership );
   137 	}
   140 	}
   138 
   141 
   139 	/**
   142 	/**
       
   143 	 * @since 2.8.0
   140 	 */
   144 	 */
   141 	public function header() {
   145 	public function header() {
   142 		if ( $this->done_header ) {
   146 		if ( $this->done_header ) {
   143 			return;
   147 			return;
   144 		}
   148 		}
   146 		echo '<div class="wrap">';
   150 		echo '<div class="wrap">';
   147 		echo '<h1>' . $this->options['title'] . '</h1>';
   151 		echo '<h1>' . $this->options['title'] . '</h1>';
   148 	}
   152 	}
   149 
   153 
   150 	/**
   154 	/**
       
   155 	 * @since 2.8.0
   151 	 */
   156 	 */
   152 	public function footer() {
   157 	public function footer() {
   153 		if ( $this->done_footer ) {
   158 		if ( $this->done_footer ) {
   154 			return;
   159 			return;
   155 		}
   160 		}
   156 		$this->done_footer = true;
   161 		$this->done_footer = true;
   157 		echo '</div>';
   162 		echo '</div>';
   158 	}
   163 	}
   159 
   164 
   160 	/**
   165 	/**
       
   166 	 * @since 2.8.0
       
   167 	 *
   161 	 * @param string|WP_Error $errors
   168 	 * @param string|WP_Error $errors
   162 	 */
   169 	 */
   163 	public function error( $errors ) {
   170 	public function error( $errors ) {
   164 		if ( ! $this->done_header ) {
   171 		if ( ! $this->done_header ) {
   165 			$this->header();
   172 			$this->header();
   176 			}
   183 			}
   177 		}
   184 		}
   178 	}
   185 	}
   179 
   186 
   180 	/**
   187 	/**
       
   188 	 * @since 2.8.0
       
   189 	 *
   181 	 * @param string $string
   190 	 * @param string $string
   182 	 * @param mixed  ...$args Optional text replacements.
   191 	 * @param mixed  ...$args Optional text replacements.
   183 	 */
   192 	 */
   184 	public function feedback( $string, ...$args ) {
   193 	public function feedback( $string, ...$args ) {
   185 		if ( isset( $this->upgrader->strings[ $string ] ) ) {
   194 		if ( isset( $this->upgrader->strings[ $string ] ) ) {
   242 				</script>';
   251 				</script>';
   243 		}
   252 		}
   244 	}
   253 	}
   245 
   254 
   246 	/**
   255 	/**
       
   256 	 * @since 3.0.0
   247 	 */
   257 	 */
   248 	public function bulk_header() {}
   258 	public function bulk_header() {}
   249 
   259 
   250 	/**
   260 	/**
       
   261 	 * @since 3.0.0
   251 	 */
   262 	 */
   252 	public function bulk_footer() {}
   263 	public function bulk_footer() {}
   253 
   264 
   254 	/**
   265 	/**
   255 	 * Hides the `process_failed` error message when updating by uploading a zip file.
   266 	 * Hides the `process_failed` error message when updating by uploading a zip file.
   256 	 *
   267 	 *
   257 	 * @since 5.5.0
   268 	 * @since 5.5.0
   258 	 *
   269 	 *
   259 	 * @param WP_Error $wp_error WP_Error
   270 	 * @param WP_Error $wp_error WP_Error object.
   260 	 * @return bool
   271 	 * @return bool
   261 	 */
   272 	 */
   262 	public function hide_process_failed( $wp_error ) {
   273 	public function hide_process_failed( $wp_error ) {
   263 		return false;
   274 		return false;
   264 	}
   275 	}