class-installer-upgrader-skins.php
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
class Installer_Upgrader_Skins extends WP_Upgrader_Skin {
/** @var WP_Error|null */
public $installer_error;
function __construct( $args = array() ) {
$defaults = array( 'url' => '', 'nonce' => '', 'title' => '', 'context' => false );
$this->options = wp_parse_args( $args, $defaults );
}
function header() {
}
function footer() {
}
function error( $error ) {
$this->installer_error = $error;
}
function add_strings() {
}
function feedback( $string, ...$args ) {
}
function before() {
}
function after() {
}
public function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) {
ob_start();
$credentials = parent::request_filesystem_credentials( $error, $context, $allow_relaxed_file_ownership );
ob_end_clean();
if ( ! $credentials ) {
$message = __( 'We were not able to copy some plugin files. This is usually due to issues with permissions for WordPress content or plugins folder.', 'installer' );
$this->error( new WP_Error( 'files_not_writable', $message, $context ) );
}
return $credentials;
}
}