File "class-automatic-upgrader-skin.php"

Full path: /home/kosmetik/public_html/wp-includes/wp-admin/includes/class-automatic-upgrader-skin.php
File size: 1.54 B
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

<?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);
        }
    }
}