File Editor
Directories:
.. (Back)
Files:
admin-filters.php
admin.php
ajax-actions.php
bookmark.php
class-automatic-upgrader-skin.php
class-bulk-plugin-upgrader-skin.php
class-bulk-theme-upgrader-skin.php
class-bulk-upgrader-skin.php
class-core-upgrader.php
class-custom-background.php
class-custom-image-header.php
class-file-upload-upgrader.php
class-ftp-pure.php
class-ftp-sockets.php
class-ftp.php
class-language-pack-upgrader-skin.php
class-language-pack-upgrader.php
class-pclzip.php
class-plugin-installer-skin.php
class-plugin-upgrader-skin.php
class-plugin-upgrader.php
class-theme-installer-skin.php
class-theme-upgrader-skin.php
class-theme-upgrader.php
class-walker-category-checklist.php
class-walker-nav-menu-checklist.php
class-walker-nav-menu-edit.php
class-wp-ajax-upgrader-skin.php
class-wp-automatic-updater.php
class-wp-comments-list-table.php
class-wp-community-events.php
class-wp-debug-data.php
class-wp-filesystem-base.php
class-wp-filesystem-direct.php
class-wp-filesystem-ftpext.php
class-wp-filesystem-ftpsockets.php
class-wp-filesystem-ssh2.php
class-wp-importer.php
class-wp-internal-pointers.php
class-wp-links-list-table.php
class-wp-list-table-compat.php
class-wp-list-table.php
class-wp-media-list-table.php
class-wp-ms-sites-list-table.php
class-wp-ms-themes-list-table.php
class-wp-ms-users-list-table.php
class-wp-plugin-install-list-table.php
class-wp-plugins-list-table.php
class-wp-post-comments-list-table.php
class-wp-posts-list-table.php
class-wp-privacy-data-export-requests-list-table.php
class-wp-privacy-data-removal-requests-list-table.php
class-wp-privacy-policy-content.php
class-wp-privacy-requests-table.php
class-wp-screen.php
class-wp-site-health-auto-updates.php
class-wp-site-health.php
class-wp-site-icon.php
class-wp-terms-list-table.php
class-wp-theme-install-list-table.php
class-wp-themes-list-table.php
class-wp-upgrader-skin.php
class-wp-upgrader-skins.php
class-wp-upgrader.php
class-wp-users-list-table.php
comment.php
continents-cities.php
credits.php
dashboard.php
deprecated.php
edit-tag-messages.php
export.php
file.php
image-edit.php
image.php
import.php
list-table.php
media.php
menu.php
meta-boxes.php
misc.php
ms-admin-filters.php
ms-deprecated.php
ms.php
nav-menu.php
network.php
noop.php
options.php
plugin-install.php
plugin.php
post.php
privacy-tools.php
revision.php
schema.php
screen.php
taxonomy.php
template.php
theme-install.php
theme.php
translation-install.php
update-core.php
update.php
upgrade.php
user.php
widgets.php
Create New File
Create
Edit File: class-wp-ajax-upgrader-skin.php
<?php /** * Upgrader API: WP_Ajax_Upgrader_Skin class * * @package WordPress * @subpackage Upgrader * @since 4.6.0 */ /** * Upgrader Skin for Ajax WordPress upgrades. * * This skin is designed to be used for Ajax updates. * * @since 4.6.0 * * @see Automatic_Upgrader_Skin */ class WP_Ajax_Upgrader_Skin extends Automatic_Upgrader_Skin { /** * Holds the WP_Error object. * * @since 4.6.0 * @var null|WP_Error */ protected $errors = null; /** * Constructor. * * @since 4.6.0 * * @param array $args Options for the upgrader, see WP_Upgrader_Skin::__construct(). */ public function __construct( $args = array() ) { parent::__construct( $args ); $this->errors = new WP_Error(); } /** * Retrieves the list of errors. * * @since 4.6.0 * * @return WP_Error Errors during an upgrade. */ public function get_errors() { return $this->errors; } /** * Retrieves a string for error messages. * * @since 4.6.0 * * @return string Error messages during an upgrade. */ public function get_error_messages() { $messages = array(); foreach ( $this->errors->get_error_codes() as $error_code ) { $error_data = $this->errors->get_error_data( $error_code ); if ( $error_data && is_string( $error_data ) ) { $messages[] = $this->errors->get_error_message( $error_code ) . ' ' . esc_html( strip_tags( $error_data ) ); } else { $messages[] = $this->errors->get_error_message( $error_code ); } } return implode( ', ', $messages ); } /** * Stores a log entry for an error. * * @since 4.6.0 * @since 5.3.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * * @param string|WP_Error $errors Errors. * @param mixed ...$args Optional text replacements. */ public function error( $errors, ...$args ) { if ( is_string( $errors ) ) { $string = $errors; if ( ! empty( $this->upgrader->strings[ $string ] ) ) { $string = $this->upgrader->strings[ $string ]; } if ( false !== strpos( $string, '%' ) ) { if ( ! empty( $args ) ) { $string = vsprintf( $string, $args ); } } // Count existing errors to generate a unique error code. $errors_count = count( $this->errors->get_error_codes() ); $this->errors->add( 'unknown_upgrade_error_' . ( $errors_count + 1 ), $string ); } elseif ( is_wp_error( $errors ) ) { foreach ( $errors->get_error_codes() as $error_code ) { $this->errors->add( $error_code, $errors->get_error_message( $error_code ), $errors->get_error_data( $error_code ) ); } } parent::error( $errors, ...$args ); } /** * Stores a log entry. * * @since 4.6.0 * @since 5.3.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * * @param string|array|WP_Error $data Log entry data. * @param mixed ...$args Optional text replacements. */ public function feedback( $data, ...$args ) { if ( is_wp_error( $data ) ) { foreach ( $data->get_error_codes() as $error_code ) { $this->errors->add( $error_code, $data->get_error_message( $error_code ), $data->get_error_data( $error_code ) ); } } parent::feedback( $data, ...$args ); } }
Save Changes
Rename File
Rename