Create New Item
×
Item Type
File
Folder
Item Name
×
Search file in folder and subfolders...
File Manager
/
wp-includes
/
wp-admin
/
includes
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php class Automatic_Upgrader_Skin extends WP_Upgrader_Skin { protected $messages = array(); public function request_filesystem_credentials($error = false, $context = '', $allow_relaxed_file_ownership = false) { if ($context) { $this->options['context'] = $context; } ob_start(); $result = parent::request_filesystem_credentials($error, $context, $allow_relaxed_file_ownership); ob_end_clean(); return $result; } public function get_upgrade_messages() { return $this->messages; } public function feedback($data, ...$args) { if (is_wp_error($data)) { $string = $data->get_error_message(); } elseif (is_array($data)) { return; } else { $string = $data; } if (!empty($this->upgrader->strings[$string])) { $string = $this->upgrader->strings[$string]; } if (strpos($string, '%') !== false) { if (!empty($args)) { $string = vsprintf($string, $args); } } $string = trim($string); $string = wp_kses($string, array('a' => array('href' => true), 'br' => true, 'em' => true, 'strong' => true)); if (empty($string)) { return; } $this->messages[] = $string; } public function header() { ob_start(); } public function footer() { $output = ob_get_clean(); if (!empty($output)) { $this->feedback($output); } } }