@@ -8,5 +8,5 @@ |
||
8 | 8 | * @subpackage Administration |
9 | 9 | */ |
10 | 10 | |
11 | -_deprecated_file( basename(__FILE__), '2.5', 'wp-admin/includes/upgrade.php' ); |
|
12 | -require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); |
|
11 | +_deprecated_file(basename(__FILE__), '2.5', 'wp-admin/includes/upgrade.php'); |
|
12 | +require_once(ABSPATH.'wp-admin/includes/upgrade.php'); |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * WordPress Upgrade Functions. Old file, must not be used. Include |
|
4 | - * wp-admin/includes/upgrade.php instead. |
|
5 | - * |
|
6 | - * @deprecated 2.5.0 |
|
7 | - * @package WordPress |
|
8 | - * @subpackage Administration |
|
9 | - */ |
|
3 | + * WordPress Upgrade Functions. Old file, must not be used. Include |
|
4 | + * wp-admin/includes/upgrade.php instead. |
|
5 | + * |
|
6 | + * @deprecated 2.5.0 |
|
7 | + * @package WordPress |
|
8 | + * @subpackage Administration |
|
9 | + */ |
|
10 | 10 | |
11 | 11 | _deprecated_file( basename(__FILE__), '2.5', 'wp-admin/includes/upgrade.php' ); |
12 | 12 | require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); |
@@ -206,12 +206,13 @@ discard block |
||
206 | 206 | $php_compat = version_compare( $php_version, $required_php_version, '>=' ); |
207 | 207 | $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' ); |
208 | 208 | |
209 | -if ( !$mysql_compat && !$php_compat ) |
|
209 | +if ( !$mysql_compat && !$php_compat ) { |
|
210 | 210 | $compat = sprintf( __( 'You cannot install because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.' ), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ); |
211 | -elseif ( !$php_compat ) |
|
211 | +} elseif ( !$php_compat ) { |
|
212 | 212 | $compat = sprintf( __( 'You cannot install because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_php_version, $php_version ); |
213 | -elseif ( !$mysql_compat ) |
|
213 | +} elseif ( !$mysql_compat ) { |
|
214 | 214 | $compat = sprintf( __( 'You cannot install because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_mysql_version, $mysql_version ); |
215 | +} |
|
215 | 216 | |
216 | 217 | if ( !$mysql_compat || !$php_compat ) { |
217 | 218 | display_header(); |
@@ -281,8 +282,9 @@ discard block |
||
281 | 282 | $loaded_language = 'en_US'; |
282 | 283 | } |
283 | 284 | |
284 | - if ( ! empty( $wpdb->error ) ) |
|
285 | - wp_die( $wpdb->error->get_error_message() ); |
|
285 | + if ( ! empty( $wpdb->error ) ) { |
|
286 | + wp_die( $wpdb->error->get_error_message() ); |
|
287 | + } |
|
286 | 288 | |
287 | 289 | display_header(); |
288 | 290 | // Fill in the data we gathered |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | // Sanity check. |
10 | -if ( false ) { |
|
10 | +if (false) { |
|
11 | 11 | ?> |
12 | 12 | <!DOCTYPE html> |
13 | 13 | <html xmlns="http://www.w3.org/1999/xhtml"> |
@@ -30,23 +30,23 @@ discard block |
||
30 | 30 | * @since 1.5.1 |
31 | 31 | * @var bool |
32 | 32 | */ |
33 | -define( 'WP_INSTALLING', true ); |
|
33 | +define('WP_INSTALLING', true); |
|
34 | 34 | |
35 | 35 | /** Load WordPress Bootstrap */ |
36 | -require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' ); |
|
36 | +require_once(dirname(dirname(__FILE__)).'/wp-load.php'); |
|
37 | 37 | |
38 | 38 | /** Load WordPress Administration Upgrade API */ |
39 | -require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); |
|
39 | +require_once(ABSPATH.'wp-admin/includes/upgrade.php'); |
|
40 | 40 | |
41 | 41 | /** Load WordPress Translation Install API */ |
42 | -require_once( ABSPATH . 'wp-admin/includes/translation-install.php' ); |
|
42 | +require_once(ABSPATH.'wp-admin/includes/translation-install.php'); |
|
43 | 43 | |
44 | 44 | /** Load wpdb */ |
45 | -require_once( ABSPATH . WPINC . '/wp-db.php' ); |
|
45 | +require_once(ABSPATH.WPINC.'/wp-db.php'); |
|
46 | 46 | |
47 | 47 | nocache_headers(); |
48 | 48 | |
49 | -$step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0; |
|
49 | +$step = isset($_GET['step']) ? (int) $_GET['step'] : 0; |
|
50 | 50 | |
51 | 51 | /** |
52 | 52 | * Display install header. |
@@ -55,13 +55,13 @@ discard block |
||
55 | 55 | * |
56 | 56 | * @param string $body_classes |
57 | 57 | */ |
58 | -function display_header( $body_classes = '' ) { |
|
59 | - header( 'Content-Type: text/html; charset=utf-8' ); |
|
60 | - if ( is_rtl() ) { |
|
58 | +function display_header($body_classes = '') { |
|
59 | + header('Content-Type: text/html; charset=utf-8'); |
|
60 | + if (is_rtl()) { |
|
61 | 61 | $body_classes .= 'rtl'; |
62 | 62 | } |
63 | - if ( $body_classes ) { |
|
64 | - $body_classes = ' ' . $body_classes; |
|
63 | + if ($body_classes) { |
|
64 | + $body_classes = ' '.$body_classes; |
|
65 | 65 | } |
66 | 66 | ?> |
67 | 67 | <!DOCTYPE html> |
@@ -70,14 +70,14 @@ discard block |
||
70 | 70 | <meta name="viewport" content="width=device-width" /> |
71 | 71 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
72 | 72 | <meta name="robots" content="noindex,nofollow" /> |
73 | - <title><?php _e( 'WordPress › Installation' ); ?></title> |
|
73 | + <title><?php _e('WordPress › Installation'); ?></title> |
|
74 | 74 | <?php |
75 | - wp_admin_css( 'install', true ); |
|
76 | - wp_admin_css( 'dashicons', true ); |
|
75 | + wp_admin_css('install', true); |
|
76 | + wp_admin_css('dashicons', true); |
|
77 | 77 | ?> |
78 | 78 | </head> |
79 | 79 | <body class="wp-core-ui<?php echo $body_classes ?>"> |
80 | -<p id="logo"><a href="<?php echo esc_url( __( 'https://wordpress.org/' ) ); ?>" tabindex="-1"><?php _e( 'WordPress' ); ?></a></p> |
|
80 | +<p id="logo"><a href="<?php echo esc_url(__('https://wordpress.org/')); ?>" tabindex="-1"><?php _e('WordPress'); ?></a></p> |
|
81 | 81 | |
82 | 82 | <?php |
83 | 83 | } // end display_header() |
@@ -89,74 +89,74 @@ discard block |
||
89 | 89 | * |
90 | 90 | * @param string|null $error |
91 | 91 | */ |
92 | -function display_setup_form( $error = null ) { |
|
92 | +function display_setup_form($error = null) { |
|
93 | 93 | global $wpdb; |
94 | 94 | |
95 | - $sql = $wpdb->prepare( "SHOW TABLES LIKE %s", $wpdb->esc_like( $wpdb->users ) ); |
|
96 | - $user_table = ( $wpdb->get_var( $sql ) != null ); |
|
95 | + $sql = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($wpdb->users)); |
|
96 | + $user_table = ($wpdb->get_var($sql) != null); |
|
97 | 97 | |
98 | 98 | // Ensure that Blogs appear in search engines by default. |
99 | 99 | $blog_public = 1; |
100 | - if ( isset( $_POST['weblog_title'] ) ) { |
|
101 | - $blog_public = isset( $_POST['blog_public'] ); |
|
100 | + if (isset($_POST['weblog_title'])) { |
|
101 | + $blog_public = isset($_POST['blog_public']); |
|
102 | 102 | } |
103 | 103 | |
104 | - $weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : ''; |
|
105 | - $user_name = isset($_POST['user_name']) ? trim( wp_unslash( $_POST['user_name'] ) ) : ''; |
|
106 | - $admin_email = isset( $_POST['admin_email'] ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : ''; |
|
104 | + $weblog_title = isset($_POST['weblog_title']) ? trim(wp_unslash($_POST['weblog_title'])) : ''; |
|
105 | + $user_name = isset($_POST['user_name']) ? trim(wp_unslash($_POST['user_name'])) : ''; |
|
106 | + $admin_email = isset($_POST['admin_email']) ? trim(wp_unslash($_POST['admin_email'])) : ''; |
|
107 | 107 | |
108 | - if ( ! is_null( $error ) ) { |
|
108 | + if ( ! is_null($error)) { |
|
109 | 109 | ?> |
110 | -<h1><?php _ex( 'Welcome', 'Howdy' ); ?></h1> |
|
110 | +<h1><?php _ex('Welcome', 'Howdy'); ?></h1> |
|
111 | 111 | <p class="message"><?php echo $error; ?></p> |
112 | 112 | <?php } ?> |
113 | 113 | <form id="setup" method="post" action="install.php?step=2" novalidate="novalidate"> |
114 | 114 | <table class="form-table"> |
115 | 115 | <tr> |
116 | - <th scope="row"><label for="weblog_title"><?php _e( 'Site Title' ); ?></label></th> |
|
117 | - <td><input name="weblog_title" type="text" id="weblog_title" size="25" value="<?php echo esc_attr( $weblog_title ); ?>" /></td> |
|
116 | + <th scope="row"><label for="weblog_title"><?php _e('Site Title'); ?></label></th> |
|
117 | + <td><input name="weblog_title" type="text" id="weblog_title" size="25" value="<?php echo esc_attr($weblog_title); ?>" /></td> |
|
118 | 118 | </tr> |
119 | 119 | <tr> |
120 | 120 | <th scope="row"><label for="user_login"><?php _e('Username'); ?></label></th> |
121 | 121 | <td> |
122 | 122 | <?php |
123 | - if ( $user_table ) { |
|
123 | + if ($user_table) { |
|
124 | 124 | _e('User(s) already exists.'); |
125 | 125 | echo '<input name="user_name" type="hidden" value="admin" />'; |
126 | 126 | } else { |
127 | - ?><input name="user_name" type="text" id="user_login" size="25" value="<?php echo esc_attr( sanitize_user( $user_name, true ) ); ?>" /> |
|
128 | - <p><?php _e( 'Usernames can have only alphanumeric characters, spaces, underscores, hyphens, periods, and the @ symbol.' ); ?></p> |
|
127 | + ?><input name="user_name" type="text" id="user_login" size="25" value="<?php echo esc_attr(sanitize_user($user_name, true)); ?>" /> |
|
128 | + <p><?php _e('Usernames can have only alphanumeric characters, spaces, underscores, hyphens, periods, and the @ symbol.'); ?></p> |
|
129 | 129 | <?php |
130 | 130 | } ?> |
131 | 131 | </td> |
132 | 132 | </tr> |
133 | - <?php if ( ! $user_table ) : ?> |
|
133 | + <?php if ( ! $user_table) : ?> |
|
134 | 134 | <tr class="form-field form-required user-pass1-wrap"> |
135 | 135 | <th scope="row"> |
136 | 136 | <label for="pass1"> |
137 | - <?php _e( 'Password' ); ?> |
|
137 | + <?php _e('Password'); ?> |
|
138 | 138 | </label> |
139 | 139 | </th> |
140 | 140 | <td> |
141 | 141 | <div class=""> |
142 | - <?php $initial_password = isset( $_POST['admin_password'] ) ? stripslashes( $_POST['admin_password'] ) : wp_generate_password( 18 ); ?> |
|
143 | - <input type="password" name="admin_password" id="pass1" class="regular-text" autocomplete="off" data-reveal="1" data-pw="<?php echo esc_attr( $initial_password ); ?>" aria-describedby="pass-strength-result" /> |
|
144 | - <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-start-masked="<?php echo (int) isset( $_POST['admin_password'] ); ?>" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>"> |
|
142 | + <?php $initial_password = isset($_POST['admin_password']) ? stripslashes($_POST['admin_password']) : wp_generate_password(18); ?> |
|
143 | + <input type="password" name="admin_password" id="pass1" class="regular-text" autocomplete="off" data-reveal="1" data-pw="<?php echo esc_attr($initial_password); ?>" aria-describedby="pass-strength-result" /> |
|
144 | + <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-start-masked="<?php echo (int) isset($_POST['admin_password']); ?>" data-toggle="0" aria-label="<?php esc_attr_e('Hide password'); ?>"> |
|
145 | 145 | <span class="dashicons dashicons-hidden"></span> |
146 | - <span class="text"><?php _e( 'Hide' ); ?></span> |
|
146 | + <span class="text"><?php _e('Hide'); ?></span> |
|
147 | 147 | </button> |
148 | 148 | <div id="pass-strength-result" aria-live="polite"></div> |
149 | 149 | </div> |
150 | 150 | <p><span class="description important hide-if-no-js"> |
151 | - <strong><?php _e( 'Important:' ); ?></strong> |
|
151 | + <strong><?php _e('Important:'); ?></strong> |
|
152 | 152 | <?php /* translators: The non-breaking space prevents 1Password from thinking the text "log in" should trigger a password save prompt. */ ?> |
153 | - <?php _e( 'You will need this password to log in. Please store it in a secure location.' ); ?></span></p> |
|
153 | + <?php _e('You will need this password to log in. Please store it in a secure location.'); ?></span></p> |
|
154 | 154 | </td> |
155 | 155 | </tr> |
156 | 156 | <tr class="form-field form-required user-pass2-wrap hide-if-js"> |
157 | 157 | <th scope="row"> |
158 | - <label for="pass2"><?php _e( 'Repeat Password' ); ?> |
|
159 | - <span class="description"><?php _e( '(required)' ); ?></span> |
|
158 | + <label for="pass2"><?php _e('Repeat Password'); ?> |
|
159 | + <span class="description"><?php _e('(required)'); ?></span> |
|
160 | 160 | </label> |
161 | 161 | </th> |
162 | 162 | <td> |
@@ -164,57 +164,57 @@ discard block |
||
164 | 164 | </td> |
165 | 165 | </tr> |
166 | 166 | <tr class="pw-weak"> |
167 | - <th scope="row"><?php _e( 'Confirm Password' ); ?></th> |
|
167 | + <th scope="row"><?php _e('Confirm Password'); ?></th> |
|
168 | 168 | <td> |
169 | 169 | <label> |
170 | 170 | <input type="checkbox" name="pw_weak" class="pw-checkbox" /> |
171 | - <?php _e( 'Confirm use of weak password' ); ?> |
|
171 | + <?php _e('Confirm use of weak password'); ?> |
|
172 | 172 | </label> |
173 | 173 | </td> |
174 | 174 | </tr> |
175 | 175 | <?php endif; ?> |
176 | 176 | <tr> |
177 | - <th scope="row"><label for="admin_email"><?php _e( 'Your Email' ); ?></label></th> |
|
178 | - <td><input name="admin_email" type="email" id="admin_email" size="25" value="<?php echo esc_attr( $admin_email ); ?>" /> |
|
179 | - <p><?php _e( 'Double-check your email address before continuing.' ); ?></p></td> |
|
177 | + <th scope="row"><label for="admin_email"><?php _e('Your Email'); ?></label></th> |
|
178 | + <td><input name="admin_email" type="email" id="admin_email" size="25" value="<?php echo esc_attr($admin_email); ?>" /> |
|
179 | + <p><?php _e('Double-check your email address before continuing.'); ?></p></td> |
|
180 | 180 | </tr> |
181 | 181 | <tr> |
182 | - <th scope="row"><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?></th> |
|
182 | + <th scope="row"><?php has_action('blog_privacy_selector') ? _e('Site Visibility') : _e('Search Engine Visibility'); ?></th> |
|
183 | 183 | <td> |
184 | 184 | <fieldset> |
185 | - <legend class="screen-reader-text"><span><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </span></legend> |
|
185 | + <legend class="screen-reader-text"><span><?php has_action('blog_privacy_selector') ? _e('Site Visibility') : _e('Search Engine Visibility'); ?> </span></legend> |
|
186 | 186 | <?php |
187 | - if ( has_action( 'blog_privacy_selector' ) ) { ?> |
|
188 | - <input id="blog-public" type="radio" name="blog_public" value="1" <?php checked( 1, $blog_public ); ?> /> |
|
189 | - <label for="blog-public"><?php _e( 'Allow search engines to index this site' );?></label><br/> |
|
190 | - <input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked( 0, $blog_public ); ?> /> |
|
191 | - <label for="blog-norobots"><?php _e( 'Discourage search engines from indexing this site' ); ?></label> |
|
192 | - <p class="description"><?php _e( 'Note: Neither of these options blocks access to your site — it is up to search engines to honor your request.' ); ?></p> |
|
187 | + if (has_action('blog_privacy_selector')) { ?> |
|
188 | + <input id="blog-public" type="radio" name="blog_public" value="1" <?php checked(1, $blog_public); ?> /> |
|
189 | + <label for="blog-public"><?php _e('Allow search engines to index this site'); ?></label><br/> |
|
190 | + <input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked(0, $blog_public); ?> /> |
|
191 | + <label for="blog-norobots"><?php _e('Discourage search engines from indexing this site'); ?></label> |
|
192 | + <p class="description"><?php _e('Note: Neither of these options blocks access to your site — it is up to search engines to honor your request.'); ?></p> |
|
193 | 193 | <?php |
194 | 194 | /** This action is documented in wp-admin/options-reading.php */ |
195 | - do_action( 'blog_privacy_selector' ); |
|
195 | + do_action('blog_privacy_selector'); |
|
196 | 196 | } else { ?> |
197 | - <label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked( 0, $blog_public ); ?> /> |
|
198 | - <?php _e( 'Discourage search engines from indexing this site' ); ?></label> |
|
199 | - <p class="description"><?php _e( 'It is up to search engines to honor this request.' ); ?></p> |
|
197 | + <label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked(0, $blog_public); ?> /> |
|
198 | + <?php _e('Discourage search engines from indexing this site'); ?></label> |
|
199 | + <p class="description"><?php _e('It is up to search engines to honor this request.'); ?></p> |
|
200 | 200 | <?php } ?> |
201 | 201 | </fieldset> |
202 | 202 | </td> |
203 | 203 | </tr> |
204 | 204 | </table> |
205 | - <p class="step"><?php submit_button( __( 'Install WordPress' ), 'large', 'Submit', false, array( 'id' => 'submit' ) ); ?></p> |
|
206 | - <input type="hidden" name="language" value="<?php echo isset( $_REQUEST['language'] ) ? esc_attr( $_REQUEST['language'] ) : ''; ?>" /> |
|
205 | + <p class="step"><?php submit_button(__('Install WordPress'), 'large', 'Submit', false, array('id' => 'submit')); ?></p> |
|
206 | + <input type="hidden" name="language" value="<?php echo isset($_REQUEST['language']) ? esc_attr($_REQUEST['language']) : ''; ?>" /> |
|
207 | 207 | </form> |
208 | 208 | <?php |
209 | 209 | } // end display_setup_form() |
210 | 210 | |
211 | 211 | // Let's check to make sure WP isn't already installed. |
212 | -if ( is_blog_installed() ) { |
|
212 | +if (is_blog_installed()) { |
|
213 | 213 | display_header(); |
214 | 214 | die( |
215 | - '<h1>' . __( 'Already Installed' ) . '</h1>' . |
|
216 | - '<p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p>' . |
|
217 | - '<p class="step"><a href="' . esc_url( wp_login_url() ) . '" class="button button-large">' . __( 'Log In' ) . '</a></p>' . |
|
215 | + '<h1>'.__('Already Installed').'</h1>'. |
|
216 | + '<p>'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'</p>'. |
|
217 | + '<p class="step"><a href="'.esc_url(wp_login_url()).'" class="button button-large">'.__('Log In').'</a></p>'. |
|
218 | 218 | '</body></html>' |
219 | 219 | ); |
220 | 220 | } |
@@ -229,43 +229,43 @@ discard block |
||
229 | 229 | |
230 | 230 | $php_version = phpversion(); |
231 | 231 | $mysql_version = $wpdb->db_version(); |
232 | -$php_compat = version_compare( $php_version, $required_php_version, '>=' ); |
|
233 | -$mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' ); |
|
232 | +$php_compat = version_compare($php_version, $required_php_version, '>='); |
|
233 | +$mysql_compat = version_compare($mysql_version, $required_mysql_version, '>=') || file_exists(WP_CONTENT_DIR.'/db.php'); |
|
234 | 234 | |
235 | -if ( !$mysql_compat && !$php_compat ) |
|
236 | - $compat = sprintf( __( 'You cannot install because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.' ), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ); |
|
237 | -elseif ( !$php_compat ) |
|
238 | - $compat = sprintf( __( 'You cannot install because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_php_version, $php_version ); |
|
239 | -elseif ( !$mysql_compat ) |
|
240 | - $compat = sprintf( __( 'You cannot install because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_mysql_version, $mysql_version ); |
|
235 | +if ( ! $mysql_compat && ! $php_compat) |
|
236 | + $compat = sprintf(__('You cannot install because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.'), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version); |
|
237 | +elseif ( ! $php_compat) |
|
238 | + $compat = sprintf(__('You cannot install because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version); |
|
239 | +elseif ( ! $mysql_compat) |
|
240 | + $compat = sprintf(__('You cannot install because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version); |
|
241 | 241 | |
242 | -if ( !$mysql_compat || !$php_compat ) { |
|
242 | +if ( ! $mysql_compat || ! $php_compat) { |
|
243 | 243 | display_header(); |
244 | - die( '<h1>' . __( 'Insufficient Requirements' ) . '</h1><p>' . $compat . '</p></body></html>' ); |
|
244 | + die('<h1>'.__('Insufficient Requirements').'</h1><p>'.$compat.'</p></body></html>'); |
|
245 | 245 | } |
246 | 246 | |
247 | -if ( ! is_string( $wpdb->base_prefix ) || '' === $wpdb->base_prefix ) { |
|
247 | +if ( ! is_string($wpdb->base_prefix) || '' === $wpdb->base_prefix) { |
|
248 | 248 | display_header(); |
249 | 249 | die( |
250 | - '<h1>' . __( 'Configuration Error' ) . '</h1>' . |
|
251 | - '<p>' . sprintf( |
|
250 | + '<h1>'.__('Configuration Error').'</h1>'. |
|
251 | + '<p>'.sprintf( |
|
252 | 252 | /* translators: %s: wp-config.php */ |
253 | - __( 'Your %s file has an empty database table prefix, which is not supported.' ), |
|
253 | + __('Your %s file has an empty database table prefix, which is not supported.'), |
|
254 | 254 | '<code>wp-config.php</code>' |
255 | - ) . '</p></body></html>' |
|
255 | + ).'</p></body></html>' |
|
256 | 256 | ); |
257 | 257 | } |
258 | 258 | |
259 | 259 | // Set error message if DO_NOT_UPGRADE_GLOBAL_TABLES isn't set as it will break install. |
260 | -if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) { |
|
260 | +if (defined('DO_NOT_UPGRADE_GLOBAL_TABLES')) { |
|
261 | 261 | display_header(); |
262 | 262 | die( |
263 | - '<h1>' . __( 'Configuration Error' ) . '</h1>' . |
|
264 | - '<p>' . sprintf( |
|
263 | + '<h1>'.__('Configuration Error').'</h1>'. |
|
264 | + '<p>'.sprintf( |
|
265 | 265 | /* translators: %s: DO_NOT_UPGRADE_GLOBAL_TABLES */ |
266 | - __( 'The constant %s cannot be defined when installing WordPress.' ), |
|
266 | + __('The constant %s cannot be defined when installing WordPress.'), |
|
267 | 267 | '<code>DO_NOT_UPGRADE_GLOBAL_TABLES</code>' |
268 | - ) . '</p></body></html>' |
|
268 | + ).'</p></body></html>' |
|
269 | 269 | ); |
270 | 270 | } |
271 | 271 | |
@@ -274,21 +274,21 @@ discard block |
||
274 | 274 | * @global WP_Locale $wp_locale |
275 | 275 | */ |
276 | 276 | $language = ''; |
277 | -if ( ! empty( $_REQUEST['language'] ) ) { |
|
278 | - $language = preg_replace( '/[^a-zA-Z_]/', '', $_REQUEST['language'] ); |
|
279 | -} elseif ( isset( $GLOBALS['wp_local_package'] ) ) { |
|
277 | +if ( ! empty($_REQUEST['language'])) { |
|
278 | + $language = preg_replace('/[^a-zA-Z_]/', '', $_REQUEST['language']); |
|
279 | +} elseif (isset($GLOBALS['wp_local_package'])) { |
|
280 | 280 | $language = $GLOBALS['wp_local_package']; |
281 | 281 | } |
282 | 282 | |
283 | -$scripts_to_print = array( 'jquery' ); |
|
283 | +$scripts_to_print = array('jquery'); |
|
284 | 284 | |
285 | -switch($step) { |
|
285 | +switch ($step) { |
|
286 | 286 | case 0: // Step 0 |
287 | - if ( wp_can_install_language_pack() && empty( $language ) && ( $languages = wp_get_available_translations() ) ) { |
|
287 | + if (wp_can_install_language_pack() && empty($language) && ($languages = wp_get_available_translations())) { |
|
288 | 288 | $scripts_to_print[] = 'language-chooser'; |
289 | - display_header( 'language-chooser' ); |
|
289 | + display_header('language-chooser'); |
|
290 | 290 | echo '<form id="setup" method="post" action="?step=1">'; |
291 | - wp_install_language_form( $languages ); |
|
291 | + wp_install_language_form($languages); |
|
292 | 292 | echo '</form>'; |
293 | 293 | break; |
294 | 294 | } |
@@ -296,10 +296,10 @@ discard block |
||
296 | 296 | // Deliberately fall through if we can't reach the translations API. |
297 | 297 | |
298 | 298 | case 1: // Step 1, direct link or from language chooser. |
299 | - if ( ! empty( $language ) ) { |
|
300 | - $loaded_language = wp_download_language_pack( $language ); |
|
301 | - if ( $loaded_language ) { |
|
302 | - load_default_textdomain( $loaded_language ); |
|
299 | + if ( ! empty($language)) { |
|
300 | + $loaded_language = wp_download_language_pack($language); |
|
301 | + if ($loaded_language) { |
|
302 | + load_default_textdomain($loaded_language); |
|
303 | 303 | $GLOBALS['wp_locale'] = new WP_Locale(); |
304 | 304 | } |
305 | 305 | } |
@@ -308,99 +308,99 @@ discard block |
||
308 | 308 | |
309 | 309 | display_header(); |
310 | 310 | ?> |
311 | -<h1><?php _ex( 'Welcome', 'Howdy' ); ?></h1> |
|
312 | -<p><?php _e( 'Welcome to the famous five-minute WordPress installation process! Just fill in the information below and you’ll be on your way to using the most extendable and powerful personal publishing platform in the world.' ); ?></p> |
|
311 | +<h1><?php _ex('Welcome', 'Howdy'); ?></h1> |
|
312 | +<p><?php _e('Welcome to the famous five-minute WordPress installation process! Just fill in the information below and you’ll be on your way to using the most extendable and powerful personal publishing platform in the world.'); ?></p> |
|
313 | 313 | |
314 | -<h2><?php _e( 'Information needed' ); ?></h2> |
|
315 | -<p><?php _e( 'Please provide the following information. Don’t worry, you can always change these settings later.' ); ?></p> |
|
314 | +<h2><?php _e('Information needed'); ?></h2> |
|
315 | +<p><?php _e('Please provide the following information. Don’t worry, you can always change these settings later.'); ?></p> |
|
316 | 316 | |
317 | 317 | <?php |
318 | 318 | display_setup_form(); |
319 | 319 | break; |
320 | 320 | case 2: |
321 | - if ( ! empty( $language ) && load_default_textdomain( $language ) ) { |
|
321 | + if ( ! empty($language) && load_default_textdomain($language)) { |
|
322 | 322 | $loaded_language = $language; |
323 | 323 | $GLOBALS['wp_locale'] = new WP_Locale(); |
324 | 324 | } else { |
325 | 325 | $loaded_language = 'en_US'; |
326 | 326 | } |
327 | 327 | |
328 | - if ( ! empty( $wpdb->error ) ) |
|
329 | - wp_die( $wpdb->error->get_error_message() ); |
|
328 | + if ( ! empty($wpdb->error)) |
|
329 | + wp_die($wpdb->error->get_error_message()); |
|
330 | 330 | |
331 | 331 | $scripts_to_print[] = 'user-profile'; |
332 | 332 | |
333 | 333 | display_header(); |
334 | 334 | // Fill in the data we gathered |
335 | - $weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : ''; |
|
336 | - $user_name = isset($_POST['user_name']) ? trim( wp_unslash( $_POST['user_name'] ) ) : ''; |
|
337 | - $admin_password = isset($_POST['admin_password']) ? wp_unslash( $_POST['admin_password'] ) : ''; |
|
338 | - $admin_password_check = isset($_POST['admin_password2']) ? wp_unslash( $_POST['admin_password2'] ) : ''; |
|
339 | - $admin_email = isset( $_POST['admin_email'] ) ?trim( wp_unslash( $_POST['admin_email'] ) ) : ''; |
|
340 | - $public = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 1; |
|
335 | + $weblog_title = isset($_POST['weblog_title']) ? trim(wp_unslash($_POST['weblog_title'])) : ''; |
|
336 | + $user_name = isset($_POST['user_name']) ? trim(wp_unslash($_POST['user_name'])) : ''; |
|
337 | + $admin_password = isset($_POST['admin_password']) ? wp_unslash($_POST['admin_password']) : ''; |
|
338 | + $admin_password_check = isset($_POST['admin_password2']) ? wp_unslash($_POST['admin_password2']) : ''; |
|
339 | + $admin_email = isset($_POST['admin_email']) ? trim(wp_unslash($_POST['admin_email'])) : ''; |
|
340 | + $public = isset($_POST['blog_public']) ? (int) $_POST['blog_public'] : 1; |
|
341 | 341 | |
342 | 342 | // Check email address. |
343 | 343 | $error = false; |
344 | - if ( empty( $user_name ) ) { |
|
344 | + if (empty($user_name)) { |
|
345 | 345 | // TODO: poka-yoke |
346 | - display_setup_form( __( 'Please provide a valid username.' ) ); |
|
346 | + display_setup_form(__('Please provide a valid username.')); |
|
347 | 347 | $error = true; |
348 | - } elseif ( $user_name != sanitize_user( $user_name, true ) ) { |
|
349 | - display_setup_form( __( 'The username you provided has invalid characters.' ) ); |
|
348 | + } elseif ($user_name != sanitize_user($user_name, true)) { |
|
349 | + display_setup_form(__('The username you provided has invalid characters.')); |
|
350 | 350 | $error = true; |
351 | - } elseif ( $admin_password != $admin_password_check ) { |
|
351 | + } elseif ($admin_password != $admin_password_check) { |
|
352 | 352 | // TODO: poka-yoke |
353 | - display_setup_form( __( 'Your passwords do not match. Please try again.' ) ); |
|
353 | + display_setup_form(__('Your passwords do not match. Please try again.')); |
|
354 | 354 | $error = true; |
355 | - } elseif ( empty( $admin_email ) ) { |
|
355 | + } elseif (empty($admin_email)) { |
|
356 | 356 | // TODO: poka-yoke |
357 | - display_setup_form( __( 'You must provide an email address.' ) ); |
|
357 | + display_setup_form(__('You must provide an email address.')); |
|
358 | 358 | $error = true; |
359 | - } elseif ( ! is_email( $admin_email ) ) { |
|
359 | + } elseif ( ! is_email($admin_email)) { |
|
360 | 360 | // TODO: poka-yoke |
361 | - display_setup_form( __( 'Sorry, that isn’t a valid email address. Email addresses look like <code>[email protected]</code>.' ) ); |
|
361 | + display_setup_form(__('Sorry, that isn’t a valid email address. Email addresses look like <code>[email protected]</code>.')); |
|
362 | 362 | $error = true; |
363 | 363 | } |
364 | 364 | |
365 | - if ( $error === false ) { |
|
365 | + if ($error === false) { |
|
366 | 366 | $wpdb->show_errors(); |
367 | - $result = wp_install( $weblog_title, $user_name, $admin_email, $public, '', wp_slash( $admin_password ), $loaded_language ); |
|
367 | + $result = wp_install($weblog_title, $user_name, $admin_email, $public, '', wp_slash($admin_password), $loaded_language); |
|
368 | 368 | ?> |
369 | 369 | |
370 | -<h1><?php _e( 'Success!' ); ?></h1> |
|
370 | +<h1><?php _e('Success!'); ?></h1> |
|
371 | 371 | |
372 | -<p><?php _e( 'WordPress has been installed. Thank you, and enjoy!' ); ?></p> |
|
372 | +<p><?php _e('WordPress has been installed. Thank you, and enjoy!'); ?></p> |
|
373 | 373 | |
374 | 374 | <table class="form-table install-success"> |
375 | 375 | <tr> |
376 | - <th><?php _e( 'Username' ); ?></th> |
|
377 | - <td><?php echo esc_html( sanitize_user( $user_name, true ) ); ?></td> |
|
376 | + <th><?php _e('Username'); ?></th> |
|
377 | + <td><?php echo esc_html(sanitize_user($user_name, true)); ?></td> |
|
378 | 378 | </tr> |
379 | 379 | <tr> |
380 | - <th><?php _e( 'Password' ); ?></th> |
|
380 | + <th><?php _e('Password'); ?></th> |
|
381 | 381 | <td><?php |
382 | - if ( ! empty( $result['password'] ) && empty( $admin_password_check ) ): ?> |
|
383 | - <code><?php echo esc_html( $result['password'] ) ?></code><br /> |
|
382 | + if ( ! empty($result['password']) && empty($admin_password_check)): ?> |
|
383 | + <code><?php echo esc_html($result['password']) ?></code><br /> |
|
384 | 384 | <?php endif ?> |
385 | 385 | <p><?php echo $result['password_message'] ?></p> |
386 | 386 | </td> |
387 | 387 | </tr> |
388 | 388 | </table> |
389 | 389 | |
390 | -<p class="step"><a href="<?php echo esc_url( wp_login_url() ); ?>" class="button button-large"><?php _e( 'Log In' ); ?></a></p> |
|
390 | +<p class="step"><a href="<?php echo esc_url(wp_login_url()); ?>" class="button button-large"><?php _e('Log In'); ?></a></p> |
|
391 | 391 | |
392 | 392 | <?php |
393 | 393 | } |
394 | 394 | break; |
395 | 395 | } |
396 | 396 | |
397 | -if ( ! wp_is_mobile() ) { |
|
397 | +if ( ! wp_is_mobile()) { |
|
398 | 398 | ?> |
399 | 399 | <script type="text/javascript">var t = document.getElementById('weblog_title'); if (t){ t.focus(); }</script> |
400 | 400 | <?php |
401 | 401 | } |
402 | 402 | |
403 | -wp_print_scripts( $scripts_to_print ); |
|
403 | +wp_print_scripts($scripts_to_print); |
|
404 | 404 | ?> |
405 | 405 | <script type="text/javascript"> |
406 | 406 | jQuery( function( $ ) { |
@@ -7,7 +7,7 @@ |
||
7 | 7 | * @since 3.0.0 |
8 | 8 | */ |
9 | 9 | |
10 | -require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
10 | +require_once(dirname(__FILE__).'/admin.php'); |
|
11 | 11 | |
12 | -wp_redirect( network_admin_url('themes.php') ); |
|
12 | +wp_redirect(network_admin_url('themes.php')); |
|
13 | 13 | exit; |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Multisite themes administration panel. |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Multisite |
|
7 | - * @since 3.0.0 |
|
8 | - */ |
|
3 | + * Multisite themes administration panel. |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Multisite |
|
7 | + * @since 3.0.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
11 | 11 |
@@ -6,16 +6,18 @@ discard block |
||
6 | 6 | * @subpackage Administration |
7 | 7 | */ |
8 | 8 | // TODO route this pages via a specific iframe handler instead of the do_action below |
9 | -if ( !defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'plugin-information' == $_GET['tab'] ) ) |
|
9 | +if ( !defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'plugin-information' == $_GET['tab'] ) ) { |
|
10 | 10 | define( 'IFRAME_REQUEST', true ); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * WordPress Administration Bootstrap. |
14 | 15 | */ |
15 | 16 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
16 | 17 | |
17 | -if ( ! current_user_can('install_plugins') ) |
|
18 | +if ( ! current_user_can('install_plugins') ) { |
|
18 | 19 | wp_die(__('You do not have sufficient permissions to install plugins on this site.')); |
20 | +} |
|
19 | 21 | |
20 | 22 | if ( is_multisite() && ! is_network_admin() ) { |
21 | 23 | wp_redirect( network_admin_url( 'plugin-install.php' ) ); |
@@ -49,8 +51,9 @@ discard block |
||
49 | 51 | $parent_file = 'plugins.php'; |
50 | 52 | |
51 | 53 | wp_enqueue_script( 'plugin-install' ); |
52 | -if ( 'plugin-information' != $tab ) |
|
54 | +if ( 'plugin-information' != $tab ) { |
|
53 | 55 | add_thickbox(); |
56 | +} |
|
54 | 57 | |
55 | 58 | $body_id = $tab; |
56 | 59 |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Install plugin administration panel. |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Administration |
|
7 | - */ |
|
3 | + * Install plugin administration panel. |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Administration |
|
7 | + */ |
|
8 | 8 | // TODO route this pages via a specific iframe handler instead of the do_action below |
9 | 9 | if ( !defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'plugin-information' == $_GET['tab'] ) ) |
10 | 10 | define( 'IFRAME_REQUEST', true ); |
@@ -6,55 +6,55 @@ discard block |
||
6 | 6 | * @subpackage Administration |
7 | 7 | */ |
8 | 8 | // TODO route this pages via a specific iframe handler instead of the do_action below |
9 | -if ( !defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'plugin-information' == $_GET['tab'] ) ) |
|
10 | - define( 'IFRAME_REQUEST', true ); |
|
9 | +if ( ! defined('IFRAME_REQUEST') && isset($_GET['tab']) && ('plugin-information' == $_GET['tab'])) |
|
10 | + define('IFRAME_REQUEST', true); |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * WordPress Administration Bootstrap. |
14 | 14 | */ |
15 | -require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
15 | +require_once(dirname(__FILE__).'/admin.php'); |
|
16 | 16 | |
17 | -if ( ! current_user_can('install_plugins') ) |
|
17 | +if ( ! current_user_can('install_plugins')) |
|
18 | 18 | wp_die(__('You do not have sufficient permissions to install plugins on this site.')); |
19 | 19 | |
20 | -if ( is_multisite() && ! is_network_admin() ) { |
|
21 | - wp_redirect( network_admin_url( 'plugin-install.php' ) ); |
|
20 | +if (is_multisite() && ! is_network_admin()) { |
|
21 | + wp_redirect(network_admin_url('plugin-install.php')); |
|
22 | 22 | exit(); |
23 | 23 | } |
24 | 24 | |
25 | 25 | $wp_list_table = _get_list_table('WP_Plugin_Install_List_Table'); |
26 | 26 | $pagenum = $wp_list_table->get_pagenum(); |
27 | 27 | |
28 | -if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) { |
|
29 | - $location = remove_query_arg( '_wp_http_referer', wp_unslash( $_SERVER['REQUEST_URI'] ) ); |
|
28 | +if ( ! empty($_REQUEST['_wp_http_referer'])) { |
|
29 | + $location = remove_query_arg('_wp_http_referer', wp_unslash($_SERVER['REQUEST_URI'])); |
|
30 | 30 | |
31 | - if ( ! empty( $_REQUEST['paged'] ) ) { |
|
32 | - $location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location ); |
|
31 | + if ( ! empty($_REQUEST['paged'])) { |
|
32 | + $location = add_query_arg('paged', (int) $_REQUEST['paged'], $location); |
|
33 | 33 | } |
34 | 34 | |
35 | - wp_redirect( $location ); |
|
35 | + wp_redirect($location); |
|
36 | 36 | exit; |
37 | 37 | } |
38 | 38 | |
39 | 39 | $wp_list_table->prepare_items(); |
40 | 40 | |
41 | -$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); |
|
41 | +$total_pages = $wp_list_table->get_pagination_arg('total_pages'); |
|
42 | 42 | |
43 | -if ( $pagenum > $total_pages && $total_pages > 0 ) { |
|
44 | - wp_redirect( add_query_arg( 'paged', $total_pages ) ); |
|
43 | +if ($pagenum > $total_pages && $total_pages > 0) { |
|
44 | + wp_redirect(add_query_arg('paged', $total_pages)); |
|
45 | 45 | exit; |
46 | 46 | } |
47 | 47 | |
48 | -$title = __( 'Add Plugins' ); |
|
48 | +$title = __('Add Plugins'); |
|
49 | 49 | $parent_file = 'plugins.php'; |
50 | 50 | |
51 | -wp_enqueue_script( 'plugin-install' ); |
|
52 | -if ( 'plugin-information' != $tab ) |
|
51 | +wp_enqueue_script('plugin-install'); |
|
52 | +if ('plugin-information' != $tab) |
|
53 | 53 | add_thickbox(); |
54 | 54 | |
55 | 55 | $body_id = $tab; |
56 | 56 | |
57 | -wp_enqueue_script( 'updates' ); |
|
57 | +wp_enqueue_script('updates'); |
|
58 | 58 | |
59 | 59 | /** |
60 | 60 | * Fires before each tab on the Install Plugins screen is loaded. |
@@ -64,60 +64,60 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @since 2.7.0 |
66 | 66 | */ |
67 | -do_action( "install_plugins_pre_$tab" ); |
|
67 | +do_action("install_plugins_pre_$tab"); |
|
68 | 68 | |
69 | -get_current_screen()->add_help_tab( array( |
|
69 | +get_current_screen()->add_help_tab(array( |
|
70 | 70 | 'id' => 'overview', |
71 | 71 | 'title' => __('Overview'), |
72 | 72 | 'content' => |
73 | - '<p>' . sprintf(__('Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from the core WordPress application by thousands of developers all over the world. All plugins in the official <a href="%s" target="_blank">WordPress.org Plugin Directory</a> are compatible with the license WordPress uses. You can find new plugins to install by searching or browsing the Directory right here in your own Plugins section.'), 'https://wordpress.org/plugins/') . '</p>' |
|
74 | -) ); |
|
75 | -get_current_screen()->add_help_tab( array( |
|
73 | + '<p>'.sprintf(__('Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from the core WordPress application by thousands of developers all over the world. All plugins in the official <a href="%s" target="_blank">WordPress.org Plugin Directory</a> are compatible with the license WordPress uses. You can find new plugins to install by searching or browsing the Directory right here in your own Plugins section.'), 'https://wordpress.org/plugins/').'</p>' |
|
74 | +)); |
|
75 | +get_current_screen()->add_help_tab(array( |
|
76 | 76 | 'id' => 'adding-plugins', |
77 | 77 | 'title' => __('Adding Plugins'), |
78 | 78 | 'content' => |
79 | - '<p>' . __('If you know what you’re looking for, Search is your best bet. The Search screen has options to search the WordPress.org Plugin Directory for a particular Term, Author, or Tag. You can also search the directory by selecting popular tags. Tags in larger type mean more plugins have been labeled with that tag.') . '</p>' . |
|
80 | - '<p>' . __('If you just want to get an idea of what’s available, you can browse Featured and Popular plugins by using the links in the upper left of the screen. These sections rotate regularly.') . '</p>' . |
|
81 | - '<p>' . __('You can also browse a user’s favorite plugins, by using the Favorites link in the upper left of the screen and entering their WordPress.org username.') . '</p>' . |
|
82 | - '<p>' . __('If you want to install a plugin that you’ve downloaded elsewhere, click the Upload link in the upper left. You will be prompted to upload the .zip package, and once uploaded, you can activate the new plugin.') . '</p>' |
|
83 | -) ); |
|
79 | + '<p>'.__('If you know what you’re looking for, Search is your best bet. The Search screen has options to search the WordPress.org Plugin Directory for a particular Term, Author, or Tag. You can also search the directory by selecting popular tags. Tags in larger type mean more plugins have been labeled with that tag.').'</p>'. |
|
80 | + '<p>'.__('If you just want to get an idea of what’s available, you can browse Featured and Popular plugins by using the links in the upper left of the screen. These sections rotate regularly.').'</p>'. |
|
81 | + '<p>'.__('You can also browse a user’s favorite plugins, by using the Favorites link in the upper left of the screen and entering their WordPress.org username.').'</p>'. |
|
82 | + '<p>'.__('If you want to install a plugin that you’ve downloaded elsewhere, click the Upload link in the upper left. You will be prompted to upload the .zip package, and once uploaded, you can activate the new plugin.').'</p>' |
|
83 | +)); |
|
84 | 84 | |
85 | 85 | get_current_screen()->set_help_sidebar( |
86 | - '<p><strong>' . __('For more information:') . '</strong></p>' . |
|
87 | - '<p>' . __('<a href="https://codex.wordpress.org/Plugins_Add_New_Screen" target="_blank">Documentation on Installing Plugins</a>') . '</p>' . |
|
88 | - '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' |
|
86 | + '<p><strong>'.__('For more information:').'</strong></p>'. |
|
87 | + '<p>'.__('<a href="https://codex.wordpress.org/Plugins_Add_New_Screen" target="_blank">Documentation on Installing Plugins</a>').'</p>'. |
|
88 | + '<p>'.__('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>').'</p>' |
|
89 | 89 | ); |
90 | 90 | |
91 | -get_current_screen()->set_screen_reader_content( array( |
|
92 | - 'heading_views' => __( 'Filter plugins list' ), |
|
93 | - 'heading_pagination' => __( 'Plugins list navigation' ), |
|
94 | - 'heading_list' => __( 'Plugins list' ), |
|
95 | -) ); |
|
91 | +get_current_screen()->set_screen_reader_content(array( |
|
92 | + 'heading_views' => __('Filter plugins list'), |
|
93 | + 'heading_pagination' => __('Plugins list navigation'), |
|
94 | + 'heading_list' => __('Plugins list'), |
|
95 | +)); |
|
96 | 96 | |
97 | 97 | /** |
98 | 98 | * WordPress Administration Template Header. |
99 | 99 | */ |
100 | -include(ABSPATH . 'wp-admin/admin-header.php'); |
|
100 | +include(ABSPATH.'wp-admin/admin-header.php'); |
|
101 | 101 | ?> |
102 | 102 | <div class="wrap"> |
103 | 103 | <h1> |
104 | 104 | <?php |
105 | - echo esc_html( $title ); |
|
106 | - if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_plugins' ) ) { |
|
107 | - if ( $tab === 'upload' ) { |
|
108 | - $href = self_admin_url( 'plugin-install.php' ); |
|
109 | - $text = _x( 'Browse', 'plugins' ); |
|
105 | + echo esc_html($title); |
|
106 | + if ( ! empty($tabs['upload']) && current_user_can('upload_plugins')) { |
|
107 | + if ($tab === 'upload') { |
|
108 | + $href = self_admin_url('plugin-install.php'); |
|
109 | + $text = _x('Browse', 'plugins'); |
|
110 | 110 | } else { |
111 | - $href = self_admin_url( 'plugin-install.php?tab=upload' ); |
|
112 | - $text = __( 'Upload Plugin' ); |
|
111 | + $href = self_admin_url('plugin-install.php?tab=upload'); |
|
112 | + $text = __('Upload Plugin'); |
|
113 | 113 | } |
114 | - echo ' <a href="' . $href . '" class="upload page-title-action">' . $text . '</a>'; |
|
114 | + echo ' <a href="'.$href.'" class="upload page-title-action">'.$text.'</a>'; |
|
115 | 115 | } |
116 | 116 | ?> |
117 | 117 | </h1> |
118 | 118 | |
119 | 119 | <?php |
120 | -if ( $tab !== 'upload' ) { |
|
120 | +if ($tab !== 'upload') { |
|
121 | 121 | $wp_list_table->views(); |
122 | 122 | echo '<br class="clear" />'; |
123 | 123 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | * |
133 | 133 | * @param int $paged The current page number of the plugins list table. |
134 | 134 | */ |
135 | -do_action( "install_plugins_$tab", $paged ); ?> |
|
135 | +do_action("install_plugins_$tab", $paged); ?> |
|
136 | 136 | </div> |
137 | 137 | |
138 | 138 | <?php |
@@ -141,4 +141,4 @@ discard block |
||
141 | 141 | /** |
142 | 142 | * WordPress Administration Template Footer. |
143 | 143 | */ |
144 | -include(ABSPATH . 'wp-admin/admin-footer.php'); |
|
144 | +include(ABSPATH.'wp-admin/admin-footer.php'); |
@@ -13,35 +13,35 @@ discard block |
||
13 | 13 | * |
14 | 14 | * @since 2.1.0 |
15 | 15 | */ |
16 | -define( 'DOING_AJAX', true ); |
|
17 | -if ( ! defined( 'WP_ADMIN' ) ) { |
|
18 | - define( 'WP_ADMIN', true ); |
|
16 | +define('DOING_AJAX', true); |
|
17 | +if ( ! defined('WP_ADMIN')) { |
|
18 | + define('WP_ADMIN', true); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | /** Load WordPress Bootstrap */ |
22 | -require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' ); |
|
22 | +require_once(dirname(dirname(__FILE__)).'/wp-load.php'); |
|
23 | 23 | |
24 | 24 | /** Allow for cross-domain requests (from the frontend). */ |
25 | 25 | send_origin_headers(); |
26 | 26 | |
27 | 27 | // Require an action parameter |
28 | -if ( empty( $_REQUEST['action'] ) ) |
|
29 | - die( '0' ); |
|
28 | +if (empty($_REQUEST['action'])) |
|
29 | + die('0'); |
|
30 | 30 | |
31 | 31 | /** Load WordPress Administration APIs */ |
32 | -require_once( ABSPATH . 'wp-admin/includes/admin.php' ); |
|
32 | +require_once(ABSPATH.'wp-admin/includes/admin.php'); |
|
33 | 33 | |
34 | 34 | /** Load Ajax Handlers for WordPress Core */ |
35 | -require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' ); |
|
35 | +require_once(ABSPATH.'wp-admin/includes/ajax-actions.php'); |
|
36 | 36 | |
37 | -@header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) ); |
|
38 | -@header( 'X-Robots-Tag: noindex' ); |
|
37 | +@header('Content-Type: text/html; charset='.get_option('blog_charset')); |
|
38 | +@header('X-Robots-Tag: noindex'); |
|
39 | 39 | |
40 | 40 | send_nosniff_header(); |
41 | 41 | nocache_headers(); |
42 | 42 | |
43 | 43 | /** This action is documented in wp-admin/admin.php */ |
44 | -do_action( 'admin_init' ); |
|
44 | +do_action('admin_init'); |
|
45 | 45 | |
46 | 46 | $core_actions_get = array( |
47 | 47 | 'fetch-list', 'ajax-tag-search', 'wp-compression-test', 'imgedit-preview', 'oembed-cache', |
@@ -69,15 +69,15 @@ discard block |
||
69 | 69 | $core_actions_post[] = 'wp-fullscreen-save-post'; |
70 | 70 | |
71 | 71 | // Register core Ajax calls. |
72 | -if ( ! empty( $_GET['action'] ) && in_array( $_GET['action'], $core_actions_get ) ) |
|
73 | - add_action( 'wp_ajax_' . $_GET['action'], 'wp_ajax_' . str_replace( '-', '_', $_GET['action'] ), 1 ); |
|
72 | +if ( ! empty($_GET['action']) && in_array($_GET['action'], $core_actions_get)) |
|
73 | + add_action('wp_ajax_'.$_GET['action'], 'wp_ajax_'.str_replace('-', '_', $_GET['action']), 1); |
|
74 | 74 | |
75 | -if ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $core_actions_post ) ) |
|
76 | - add_action( 'wp_ajax_' . $_POST['action'], 'wp_ajax_' . str_replace( '-', '_', $_POST['action'] ), 1 ); |
|
75 | +if ( ! empty($_POST['action']) && in_array($_POST['action'], $core_actions_post)) |
|
76 | + add_action('wp_ajax_'.$_POST['action'], 'wp_ajax_'.str_replace('-', '_', $_POST['action']), 1); |
|
77 | 77 | |
78 | -add_action( 'wp_ajax_nopriv_heartbeat', 'wp_ajax_nopriv_heartbeat', 1 ); |
|
78 | +add_action('wp_ajax_nopriv_heartbeat', 'wp_ajax_nopriv_heartbeat', 1); |
|
79 | 79 | |
80 | -if ( is_user_logged_in() ) { |
|
80 | +if (is_user_logged_in()) { |
|
81 | 81 | /** |
82 | 82 | * Fires authenticated AJAX actions for logged-in users. |
83 | 83 | * |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @since 2.1.0 |
88 | 88 | */ |
89 | - do_action( 'wp_ajax_' . $_REQUEST['action'] ); |
|
89 | + do_action('wp_ajax_'.$_REQUEST['action']); |
|
90 | 90 | } else { |
91 | 91 | /** |
92 | 92 | * Fires non-authenticated AJAX actions for logged-out users. |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @since 2.8.0 |
98 | 98 | */ |
99 | - do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] ); |
|
99 | + do_action('wp_ajax_nopriv_'.$_REQUEST['action']); |
|
100 | 100 | } |
101 | 101 | // Default status |
102 | -die( '0' ); |
|
102 | +die('0'); |
@@ -25,8 +25,9 @@ discard block |
||
25 | 25 | send_origin_headers(); |
26 | 26 | |
27 | 27 | // Require an action parameter |
28 | -if ( empty( $_REQUEST['action'] ) ) |
|
28 | +if ( empty( $_REQUEST['action'] ) ) { |
|
29 | 29 | die( '0' ); |
30 | +} |
|
30 | 31 | |
31 | 32 | /** Load WordPress Administration APIs */ |
32 | 33 | require_once( ABSPATH . 'wp-admin/includes/admin.php' ); |
@@ -69,11 +70,13 @@ discard block |
||
69 | 70 | $core_actions_post[] = 'wp-fullscreen-save-post'; |
70 | 71 | |
71 | 72 | // Register core Ajax calls. |
72 | -if ( ! empty( $_GET['action'] ) && in_array( $_GET['action'], $core_actions_get ) ) |
|
73 | +if ( ! empty( $_GET['action'] ) && in_array( $_GET['action'], $core_actions_get ) ) { |
|
73 | 74 | add_action( 'wp_ajax_' . $_GET['action'], 'wp_ajax_' . str_replace( '-', '_', $_GET['action'] ), 1 ); |
75 | +} |
|
74 | 76 | |
75 | -if ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $core_actions_post ) ) |
|
77 | +if ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $core_actions_post ) ) { |
|
76 | 78 | add_action( 'wp_ajax_' . $_POST['action'], 'wp_ajax_' . str_replace( '-', '_', $_POST['action'] ), 1 ); |
79 | +} |
|
77 | 80 | |
78 | 81 | add_action( 'wp_ajax_nopriv_heartbeat', 'wp_ajax_nopriv_heartbeat', 1 ); |
79 | 82 |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * WordPress AJAX Process Execution. |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Administration |
|
7 | - * |
|
8 | - * @link https://codex.wordpress.org/AJAX_in_Plugins |
|
9 | - */ |
|
3 | + * WordPress AJAX Process Execution. |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Administration |
|
7 | + * |
|
8 | + * @link https://codex.wordpress.org/AJAX_in_Plugins |
|
9 | + */ |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * Executing AJAX process. |
@@ -9,8 +9,9 @@ discard block |
||
9 | 9 | /** WordPress Administration Bootstrap */ |
10 | 10 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
11 | 11 | |
12 | -if ( ! current_user_can( 'manage_options' ) ) |
|
12 | +if ( ! current_user_can( 'manage_options' ) ) { |
|
13 | 13 | wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); |
14 | +} |
|
14 | 15 | |
15 | 16 | $title = __('Writing Settings'); |
16 | 17 | $parent_file = 'options-general.php'; |
@@ -164,9 +165,12 @@ discard block |
||
164 | 165 | |
165 | 166 | <textarea name="ping_sites" id="ping_sites" class="large-text code" rows="3"><?php echo esc_textarea( get_option('ping_sites') ); ?></textarea> |
166 | 167 | |
167 | -<?php else : ?> |
|
168 | +<?php else { |
|
169 | + : ?> |
|
168 | 170 | |
169 | - <p><?php printf(__('WordPress is not notifying any <a href="https://codex.wordpress.org/Update_Services">Update Services</a> because of your site’s <a href="%s">visibility settings</a>.'), 'options-reading.php'); ?></p> |
|
171 | + <p><?php printf(__('WordPress is not notifying any <a href="https://codex.wordpress.org/Update_Services">Update Services</a> because of your site’s <a href="%s">visibility settings</a>.'), 'options-reading.php'); |
|
172 | +} |
|
173 | +?></p> |
|
170 | 174 | |
171 | 175 | <?php endif; ?> |
172 | 176 | <?php } // multisite ?> |
@@ -7,56 +7,56 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | /** WordPress Administration Bootstrap */ |
10 | -require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
10 | +require_once(dirname(__FILE__).'/admin.php'); |
|
11 | 11 | |
12 | -if ( ! current_user_can( 'manage_options' ) ) |
|
13 | - wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); |
|
12 | +if ( ! current_user_can('manage_options')) |
|
13 | + wp_die(__('You do not have sufficient permissions to manage options for this site.')); |
|
14 | 14 | |
15 | 15 | $title = __('Writing Settings'); |
16 | 16 | $parent_file = 'options-general.php'; |
17 | 17 | |
18 | -get_current_screen()->add_help_tab( array( |
|
18 | +get_current_screen()->add_help_tab(array( |
|
19 | 19 | 'id' => 'overview', |
20 | 20 | 'title' => __('Overview'), |
21 | - 'content' => '<p>' . __('You can submit content in several different ways; this screen holds the settings for all of them. The top section controls the editor within the dashboard, while the rest control external publishing methods. For more information on any of these methods, use the documentation links.') . '</p>' . |
|
22 | - '<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>', |
|
23 | -) ); |
|
21 | + 'content' => '<p>'.__('You can submit content in several different ways; this screen holds the settings for all of them. The top section controls the editor within the dashboard, while the rest control external publishing methods. For more information on any of these methods, use the documentation links.').'</p>'. |
|
22 | + '<p>'.__('You must click the Save Changes button at the bottom of the screen for new settings to take effect.').'</p>', |
|
23 | +)); |
|
24 | 24 | |
25 | 25 | /** This filter is documented in wp-admin/options.php */ |
26 | -if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { |
|
27 | - get_current_screen()->add_help_tab( array( |
|
26 | +if (apply_filters('enable_post_by_email_configuration', true)) { |
|
27 | + get_current_screen()->add_help_tab(array( |
|
28 | 28 | 'id' => 'options-postemail', |
29 | - 'title' => __( 'Post Via Email' ), |
|
30 | - 'content' => '<p>' . __( 'Post via email settings allow you to send your WordPress install an email with the content of your post. You must set up a secret email account with POP3 access to use this, and any mail received at this address will be posted, so it’s a good idea to keep this address very secret.' ) . '</p>', |
|
31 | - ) ); |
|
29 | + 'title' => __('Post Via Email'), |
|
30 | + 'content' => '<p>'.__('Post via email settings allow you to send your WordPress install an email with the content of your post. You must set up a secret email account with POP3 access to use this, and any mail received at this address will be posted, so it’s a good idea to keep this address very secret.').'</p>', |
|
31 | + )); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** This filter is documented in wp-admin/options-writing.php */ |
35 | -if ( apply_filters( 'enable_update_services_configuration', true ) ) { |
|
36 | - get_current_screen()->add_help_tab( array( |
|
35 | +if (apply_filters('enable_update_services_configuration', true)) { |
|
36 | + get_current_screen()->add_help_tab(array( |
|
37 | 37 | 'id' => 'options-services', |
38 | - 'title' => __( 'Update Services' ), |
|
39 | - 'content' => '<p>' . __( 'If desired, WordPress will automatically alert various services of your new posts.' ) . '</p>', |
|
40 | - ) ); |
|
38 | + 'title' => __('Update Services'), |
|
39 | + 'content' => '<p>'.__('If desired, WordPress will automatically alert various services of your new posts.').'</p>', |
|
40 | + )); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | get_current_screen()->set_help_sidebar( |
44 | - '<p><strong>' . __('For more information:') . '</strong></p>' . |
|
45 | - '<p>' . __('<a href="https://codex.wordpress.org/Settings_Writing_Screen" target="_blank">Documentation on Writing Settings</a>') . '</p>' . |
|
46 | - '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' |
|
44 | + '<p><strong>'.__('For more information:').'</strong></p>'. |
|
45 | + '<p>'.__('<a href="https://codex.wordpress.org/Settings_Writing_Screen" target="_blank">Documentation on Writing Settings</a>').'</p>'. |
|
46 | + '<p>'.__('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>').'</p>' |
|
47 | 47 | ); |
48 | 48 | |
49 | -include( ABSPATH . 'wp-admin/admin-header.php' ); |
|
49 | +include(ABSPATH.'wp-admin/admin-header.php'); |
|
50 | 50 | ?> |
51 | 51 | |
52 | 52 | <div class="wrap"> |
53 | -<h1><?php echo esc_html( $title ); ?></h1> |
|
53 | +<h1><?php echo esc_html($title); ?></h1> |
|
54 | 54 | |
55 | 55 | <form method="post" action="options.php"> |
56 | 56 | <?php settings_fields('writing'); ?> |
57 | 57 | |
58 | 58 | <table class="form-table"> |
59 | -<?php if ( get_site_option( 'initial_db_version' ) < 32453 ) : ?> |
|
59 | +<?php if (get_site_option('initial_db_version') < 32453) : ?> |
|
60 | 60 | <tr> |
61 | 61 | <th scope="row"><?php _e('Formatting') ?></th> |
62 | 62 | <td><fieldset><legend class="screen-reader-text"><span><?php _e('Formatting') ?></span></legend> |
@@ -77,21 +77,21 @@ discard block |
||
77 | 77 | </tr> |
78 | 78 | <?php |
79 | 79 | $post_formats = get_post_format_strings(); |
80 | -unset( $post_formats['standard'] ); |
|
80 | +unset($post_formats['standard']); |
|
81 | 81 | ?> |
82 | 82 | <tr> |
83 | 83 | <th scope="row"><label for="default_post_format"><?php _e('Default Post Format') ?></label></th> |
84 | 84 | <td> |
85 | 85 | <select name="default_post_format" id="default_post_format"> |
86 | - <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option> |
|
87 | -<?php foreach ( $post_formats as $format_slug => $format_name ): ?> |
|
88 | - <option<?php selected( get_option( 'default_post_format' ), $format_slug ); ?> value="<?php echo esc_attr( $format_slug ); ?>"><?php echo esc_html( $format_name ); ?></option> |
|
86 | + <option value="0"><?php echo get_post_format_string('standard'); ?></option> |
|
87 | +<?php foreach ($post_formats as $format_slug => $format_name): ?> |
|
88 | + <option<?php selected(get_option('default_post_format'), $format_slug); ?> value="<?php echo esc_attr($format_slug); ?>"><?php echo esc_html($format_name); ?></option> |
|
89 | 89 | <?php endforeach; ?> |
90 | 90 | </select> |
91 | 91 | </td> |
92 | 92 | </tr> |
93 | 93 | <?php |
94 | -if ( get_option( 'link_manager_enabled' ) ) : |
|
94 | +if (get_option('link_manager_enabled')) : |
|
95 | 95 | ?> |
96 | 96 | <tr> |
97 | 97 | <th scope="row"><label for="default_link_category"><?php _e('Default Link Category') ?></label></th> |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | |
112 | 112 | <?php |
113 | 113 | /** This filter is documented in wp-admin/options.php */ |
114 | -if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { |
|
114 | +if (apply_filters('enable_post_by_email_configuration', true)) { |
|
115 | 115 | ?> |
116 | -<h2 class="title"><?php _e( 'Post via email' ) ?></h2> |
|
116 | +<h2 class="title"><?php _e('Post via email') ?></h2> |
|
117 | 117 | <p><?php printf(__('To post to WordPress by email you must set up a secret email account with POP3 access. Any mail received at this address will be posted, so it’s a good idea to keep this address very secret. Here are three random strings you could use: <kbd>%s</kbd>, <kbd>%s</kbd>, <kbd>%s</kbd>.'), wp_generate_password(8, false), wp_generate_password(8, false), wp_generate_password(8, false)) ?></p> |
118 | 118 | |
119 | 119 | <table class="form-table"> |
@@ -154,15 +154,15 @@ discard block |
||
154 | 154 | * |
155 | 155 | * @param bool $enable Whether to enable the Update Services settings area. Default true. |
156 | 156 | */ |
157 | -if ( apply_filters( 'enable_update_services_configuration', true ) ) { |
|
157 | +if (apply_filters('enable_update_services_configuration', true)) { |
|
158 | 158 | ?> |
159 | -<h2 class="title"><?php _e( 'Update Services' ) ?></h2> |
|
159 | +<h2 class="title"><?php _e('Update Services') ?></h2> |
|
160 | 160 | |
161 | -<?php if ( 1 == get_option('blog_public') ) : ?> |
|
161 | +<?php if (1 == get_option('blog_public')) : ?> |
|
162 | 162 | |
163 | -<p><label for="ping_sites"><?php _e( 'When you publish a new post, WordPress automatically notifies the following site update services. For more about this, see <a href="https://codex.wordpress.org/Update_Services">Update Services</a> on the Codex. Separate multiple service URLs with line breaks.' ) ?></label></p> |
|
163 | +<p><label for="ping_sites"><?php _e('When you publish a new post, WordPress automatically notifies the following site update services. For more about this, see <a href="https://codex.wordpress.org/Update_Services">Update Services</a> on the Codex. Separate multiple service URLs with line breaks.') ?></label></p> |
|
164 | 164 | |
165 | -<textarea name="ping_sites" id="ping_sites" class="large-text code" rows="3"><?php echo esc_textarea( get_option('ping_sites') ); ?></textarea> |
|
165 | +<textarea name="ping_sites" id="ping_sites" class="large-text code" rows="3"><?php echo esc_textarea(get_option('ping_sites')); ?></textarea> |
|
166 | 166 | |
167 | 167 | <?php else : ?> |
168 | 168 | |
@@ -177,4 +177,4 @@ discard block |
||
177 | 177 | </form> |
178 | 178 | </div> |
179 | 179 | |
180 | -<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?> |
|
180 | +<?php include(ABSPATH.'wp-admin/admin-footer.php'); ?> |
@@ -6,9 +6,9 @@ discard block |
||
6 | 6 | * @subpackage Administration |
7 | 7 | */ |
8 | 8 | |
9 | -@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); |
|
10 | -if ( ! defined( 'WP_ADMIN' ) ) |
|
11 | - require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
9 | +@header('Content-Type: '.get_option('html_type').'; charset='.get_option('blog_charset')); |
|
10 | +if ( ! defined('WP_ADMIN')) |
|
11 | + require_once(dirname(__FILE__).'/admin.php'); |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * In case admin-header.php is included in a function. |
@@ -27,23 +27,23 @@ discard block |
||
27 | 27 | $update_title, $total_update_count, $parent_file; |
28 | 28 | |
29 | 29 | // Catch plugins that include admin-header.php before admin.php completes. |
30 | -if ( empty( $current_screen ) ) |
|
30 | +if (empty($current_screen)) |
|
31 | 31 | set_current_screen(); |
32 | 32 | |
33 | 33 | get_admin_page_title(); |
34 | -$title = esc_html( strip_tags( $title ) ); |
|
34 | +$title = esc_html(strip_tags($title)); |
|
35 | 35 | |
36 | -if ( is_network_admin() ) |
|
37 | - $admin_title = sprintf( __( 'Network Admin: %s' ), esc_html( get_current_site()->site_name ) ); |
|
38 | -elseif ( is_user_admin() ) |
|
39 | - $admin_title = sprintf( __( 'User Dashboard: %s' ), esc_html( get_current_site()->site_name ) ); |
|
36 | +if (is_network_admin()) |
|
37 | + $admin_title = sprintf(__('Network Admin: %s'), esc_html(get_current_site()->site_name)); |
|
38 | +elseif (is_user_admin()) |
|
39 | + $admin_title = sprintf(__('User Dashboard: %s'), esc_html(get_current_site()->site_name)); |
|
40 | 40 | else |
41 | - $admin_title = get_bloginfo( 'name' ); |
|
41 | + $admin_title = get_bloginfo('name'); |
|
42 | 42 | |
43 | -if ( $admin_title == $title ) |
|
44 | - $admin_title = sprintf( __( '%1$s — WordPress' ), $title ); |
|
43 | +if ($admin_title == $title) |
|
44 | + $admin_title = sprintf(__('%1$s — WordPress'), $title); |
|
45 | 45 | else |
46 | - $admin_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $title, $admin_title ); |
|
46 | + $admin_title = sprintf(__('%1$s ‹ %2$s — WordPress'), $title, $admin_title); |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * Filter the title tag content for an admin page. |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @param string $admin_title The page title, with extra context added. |
54 | 54 | * @param string $title The original page title. |
55 | 55 | */ |
56 | -$admin_title = apply_filters( 'admin_title', $admin_title, $title ); |
|
56 | +$admin_title = apply_filters('admin_title', $admin_title, $title); |
|
57 | 57 | |
58 | 58 | wp_user_settings(); |
59 | 59 | |
@@ -62,21 +62,21 @@ discard block |
||
62 | 62 | <title><?php echo $admin_title; ?></title> |
63 | 63 | <?php |
64 | 64 | |
65 | -wp_enqueue_style( 'colors' ); |
|
66 | -wp_enqueue_style( 'ie' ); |
|
65 | +wp_enqueue_style('colors'); |
|
66 | +wp_enqueue_style('ie'); |
|
67 | 67 | wp_enqueue_script('utils'); |
68 | -wp_enqueue_script( 'svg-painter' ); |
|
68 | +wp_enqueue_script('svg-painter'); |
|
69 | 69 | |
70 | 70 | $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix); |
71 | 71 | ?> |
72 | 72 | <script type="text/javascript"> |
73 | 73 | addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; |
74 | -var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', |
|
74 | +var ajaxurl = '<?php echo admin_url('admin-ajax.php', 'relative'); ?>', |
|
75 | 75 | pagenow = '<?php echo $current_screen->id; ?>', |
76 | 76 | typenow = '<?php echo $current_screen->post_type; ?>', |
77 | 77 | adminpage = '<?php echo $admin_body_class; ?>', |
78 | - thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>', |
|
79 | - decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>', |
|
78 | + thousandsSeparator = '<?php echo addslashes($wp_locale->number_format['thousands_sep']); ?>', |
|
79 | + decimalPoint = '<?php echo addslashes($wp_locale->number_format['decimal_point']); ?>', |
|
80 | 80 | isRtl = <?php echo (int) is_rtl(); ?>; |
81 | 81 | </script> |
82 | 82 | <meta name="viewport" content="width=device-width,initial-scale=1.0"> |
@@ -89,35 +89,35 @@ discard block |
||
89 | 89 | * |
90 | 90 | * @param string $hook_suffix The current admin page. |
91 | 91 | */ |
92 | -do_action( 'admin_enqueue_scripts', $hook_suffix ); |
|
92 | +do_action('admin_enqueue_scripts', $hook_suffix); |
|
93 | 93 | |
94 | 94 | /** |
95 | 95 | * Fires when styles are printed for a specific admin page based on $hook_suffix. |
96 | 96 | * |
97 | 97 | * @since 2.6.0 |
98 | 98 | */ |
99 | -do_action( "admin_print_styles-$hook_suffix" ); |
|
99 | +do_action("admin_print_styles-$hook_suffix"); |
|
100 | 100 | |
101 | 101 | /** |
102 | 102 | * Fires when styles are printed for all admin pages. |
103 | 103 | * |
104 | 104 | * @since 2.6.0 |
105 | 105 | */ |
106 | -do_action( 'admin_print_styles' ); |
|
106 | +do_action('admin_print_styles'); |
|
107 | 107 | |
108 | 108 | /** |
109 | 109 | * Fires when scripts are printed for a specific admin page based on $hook_suffix. |
110 | 110 | * |
111 | 111 | * @since 2.1.0 |
112 | 112 | */ |
113 | -do_action( "admin_print_scripts-$hook_suffix" ); |
|
113 | +do_action("admin_print_scripts-$hook_suffix"); |
|
114 | 114 | |
115 | 115 | /** |
116 | 116 | * Fires when scripts are printed for all admin pages. |
117 | 117 | * |
118 | 118 | * @since 2.1.0 |
119 | 119 | */ |
120 | -do_action( 'admin_print_scripts' ); |
|
120 | +do_action('admin_print_scripts'); |
|
121 | 121 | |
122 | 122 | /** |
123 | 123 | * Fires in head section for a specific admin page. |
@@ -127,45 +127,45 @@ discard block |
||
127 | 127 | * |
128 | 128 | * @since 2.1.0 |
129 | 129 | */ |
130 | -do_action( "admin_head-$hook_suffix" ); |
|
130 | +do_action("admin_head-$hook_suffix"); |
|
131 | 131 | |
132 | 132 | /** |
133 | 133 | * Fires in head section for all admin pages. |
134 | 134 | * |
135 | 135 | * @since 2.1.0 |
136 | 136 | */ |
137 | -do_action( 'admin_head' ); |
|
137 | +do_action('admin_head'); |
|
138 | 138 | |
139 | -if ( get_user_setting('mfold') == 'f' ) |
|
139 | +if (get_user_setting('mfold') == 'f') |
|
140 | 140 | $admin_body_class .= ' folded'; |
141 | 141 | |
142 | -if ( !get_user_setting('unfold') ) |
|
142 | +if ( ! get_user_setting('unfold')) |
|
143 | 143 | $admin_body_class .= ' auto-fold'; |
144 | 144 | |
145 | -if ( is_admin_bar_showing() ) |
|
145 | +if (is_admin_bar_showing()) |
|
146 | 146 | $admin_body_class .= ' admin-bar'; |
147 | 147 | |
148 | -if ( is_rtl() ) |
|
148 | +if (is_rtl()) |
|
149 | 149 | $admin_body_class .= ' rtl'; |
150 | 150 | |
151 | -if ( $current_screen->post_type ) |
|
152 | - $admin_body_class .= ' post-type-' . $current_screen->post_type; |
|
151 | +if ($current_screen->post_type) |
|
152 | + $admin_body_class .= ' post-type-'.$current_screen->post_type; |
|
153 | 153 | |
154 | -if ( $current_screen->taxonomy ) |
|
155 | - $admin_body_class .= ' taxonomy-' . $current_screen->taxonomy; |
|
154 | +if ($current_screen->taxonomy) |
|
155 | + $admin_body_class .= ' taxonomy-'.$current_screen->taxonomy; |
|
156 | 156 | |
157 | -$admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) ); |
|
158 | -$admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) ); |
|
159 | -$admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' ); |
|
160 | -$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); |
|
157 | +$admin_body_class .= ' branch-'.str_replace(array('.', ','), '-', floatval($wp_version)); |
|
158 | +$admin_body_class .= ' version-'.str_replace('.', '-', preg_replace('/^([.0-9]+).*/', '$1', $wp_version)); |
|
159 | +$admin_body_class .= ' admin-color-'.sanitize_html_class(get_user_option('admin_color'), 'fresh'); |
|
160 | +$admin_body_class .= ' locale-'.sanitize_html_class(strtolower(str_replace('_', '-', get_locale()))); |
|
161 | 161 | |
162 | -if ( wp_is_mobile() ) |
|
162 | +if (wp_is_mobile()) |
|
163 | 163 | $admin_body_class .= ' mobile'; |
164 | 164 | |
165 | -if ( is_multisite() ) |
|
165 | +if (is_multisite()) |
|
166 | 166 | $admin_body_class .= ' multisite'; |
167 | 167 | |
168 | -if ( is_network_admin() ) |
|
168 | +if (is_network_admin()) |
|
169 | 169 | $admin_body_class .= ' network-admin'; |
170 | 170 | |
171 | 171 | $admin_body_class .= ' no-customize-support no-svg'; |
@@ -187,22 +187,22 @@ discard block |
||
187 | 187 | * |
188 | 188 | * @param string $classes Space-separated list of CSS classes. |
189 | 189 | */ |
190 | -$admin_body_classes = apply_filters( 'admin_body_class', '' ); |
|
190 | +$admin_body_classes = apply_filters('admin_body_class', ''); |
|
191 | 191 | ?> |
192 | -<body class="wp-admin wp-core-ui no-js <?php echo $admin_body_classes . ' ' . $admin_body_class; ?>"> |
|
192 | +<body class="wp-admin wp-core-ui no-js <?php echo $admin_body_classes.' '.$admin_body_class; ?>"> |
|
193 | 193 | <script type="text/javascript"> |
194 | 194 | document.body.className = document.body.className.replace('no-js','js'); |
195 | 195 | </script> |
196 | 196 | |
197 | 197 | <?php |
198 | 198 | // Make sure the customize body classes are correct as early as possible. |
199 | -if ( current_user_can( 'customize' ) ) { |
|
199 | +if (current_user_can('customize')) { |
|
200 | 200 | wp_customize_support_script(); |
201 | 201 | } |
202 | 202 | ?> |
203 | 203 | |
204 | 204 | <div id="wpwrap"> |
205 | -<?php require(ABSPATH . 'wp-admin/menu-header.php'); ?> |
|
205 | +<?php require(ABSPATH.'wp-admin/menu-header.php'); ?> |
|
206 | 206 | <div id="wpcontent"> |
207 | 207 | |
208 | 208 | <?php |
@@ -211,14 +211,14 @@ discard block |
||
211 | 211 | * |
212 | 212 | * @since 3.0.0 |
213 | 213 | */ |
214 | -do_action( 'in_admin_header' ); |
|
214 | +do_action('in_admin_header'); |
|
215 | 215 | ?> |
216 | 216 | |
217 | 217 | <div id="wpbody" role="main"> |
218 | 218 | <?php |
219 | 219 | unset($title_class, $blog_name, $total_update_count, $update_title); |
220 | 220 | |
221 | -$current_screen->set_parentage( $parent_file ); |
|
221 | +$current_screen->set_parentage($parent_file); |
|
222 | 222 | |
223 | 223 | ?> |
224 | 224 | |
@@ -227,27 +227,27 @@ discard block |
||
227 | 227 | |
228 | 228 | $current_screen->render_screen_meta(); |
229 | 229 | |
230 | -if ( is_network_admin() ) { |
|
230 | +if (is_network_admin()) { |
|
231 | 231 | /** |
232 | 232 | * Print network admin screen notices. |
233 | 233 | * |
234 | 234 | * @since 3.1.0 |
235 | 235 | */ |
236 | - do_action( 'network_admin_notices' ); |
|
237 | -} elseif ( is_user_admin() ) { |
|
236 | + do_action('network_admin_notices'); |
|
237 | +} elseif (is_user_admin()) { |
|
238 | 238 | /** |
239 | 239 | * Print user admin screen notices. |
240 | 240 | * |
241 | 241 | * @since 3.1.0 |
242 | 242 | */ |
243 | - do_action( 'user_admin_notices' ); |
|
243 | + do_action('user_admin_notices'); |
|
244 | 244 | } else { |
245 | 245 | /** |
246 | 246 | * Print admin screen notices. |
247 | 247 | * |
248 | 248 | * @since 3.1.0 |
249 | 249 | */ |
250 | - do_action( 'admin_notices' ); |
|
250 | + do_action('admin_notices'); |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | /** |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | * |
256 | 256 | * @since 3.1.0 |
257 | 257 | */ |
258 | -do_action( 'all_admin_notices' ); |
|
258 | +do_action('all_admin_notices'); |
|
259 | 259 | |
260 | -if ( $parent_file == 'options-general.php' ) |
|
261 | - require(ABSPATH . 'wp-admin/options-head.php'); |
|
260 | +if ($parent_file == 'options-general.php') |
|
261 | + require(ABSPATH.'wp-admin/options-head.php'); |
@@ -7,8 +7,9 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); |
10 | -if ( ! defined( 'WP_ADMIN' ) ) |
|
10 | +if ( ! defined( 'WP_ADMIN' ) ) { |
|
11 | 11 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
12 | +} |
|
12 | 13 | |
13 | 14 | /** |
14 | 15 | * In case admin-header.php is included in a function. |
@@ -27,23 +28,26 @@ discard block |
||
27 | 28 | $update_title, $total_update_count, $parent_file; |
28 | 29 | |
29 | 30 | // Catch plugins that include admin-header.php before admin.php completes. |
30 | -if ( empty( $current_screen ) ) |
|
31 | +if ( empty( $current_screen ) ) { |
|
31 | 32 | set_current_screen(); |
33 | +} |
|
32 | 34 | |
33 | 35 | get_admin_page_title(); |
34 | 36 | $title = esc_html( strip_tags( $title ) ); |
35 | 37 | |
36 | -if ( is_network_admin() ) |
|
38 | +if ( is_network_admin() ) { |
|
37 | 39 | $admin_title = sprintf( __( 'Network Admin: %s' ), esc_html( get_current_site()->site_name ) ); |
38 | -elseif ( is_user_admin() ) |
|
40 | +} elseif ( is_user_admin() ) { |
|
39 | 41 | $admin_title = sprintf( __( 'User Dashboard: %s' ), esc_html( get_current_site()->site_name ) ); |
40 | -else |
|
42 | +} else { |
|
41 | 43 | $admin_title = get_bloginfo( 'name' ); |
44 | +} |
|
42 | 45 | |
43 | -if ( $admin_title == $title ) |
|
46 | +if ( $admin_title == $title ) { |
|
44 | 47 | $admin_title = sprintf( __( '%1$s — WordPress' ), $title ); |
45 | -else |
|
48 | +} else { |
|
46 | 49 | $admin_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $title, $admin_title ); |
50 | +} |
|
47 | 51 | |
48 | 52 | /** |
49 | 53 | * Filter the title tag content for an admin page. |
@@ -136,37 +140,46 @@ discard block |
||
136 | 140 | */ |
137 | 141 | do_action( 'admin_head' ); |
138 | 142 | |
139 | -if ( get_user_setting('mfold') == 'f' ) |
|
143 | +if ( get_user_setting('mfold') == 'f' ) { |
|
140 | 144 | $admin_body_class .= ' folded'; |
145 | +} |
|
141 | 146 | |
142 | -if ( !get_user_setting('unfold') ) |
|
147 | +if ( !get_user_setting('unfold') ) { |
|
143 | 148 | $admin_body_class .= ' auto-fold'; |
149 | +} |
|
144 | 150 | |
145 | -if ( is_admin_bar_showing() ) |
|
151 | +if ( is_admin_bar_showing() ) { |
|
146 | 152 | $admin_body_class .= ' admin-bar'; |
153 | +} |
|
147 | 154 | |
148 | -if ( is_rtl() ) |
|
155 | +if ( is_rtl() ) { |
|
149 | 156 | $admin_body_class .= ' rtl'; |
157 | +} |
|
150 | 158 | |
151 | -if ( $current_screen->post_type ) |
|
159 | +if ( $current_screen->post_type ) { |
|
152 | 160 | $admin_body_class .= ' post-type-' . $current_screen->post_type; |
161 | +} |
|
153 | 162 | |
154 | -if ( $current_screen->taxonomy ) |
|
163 | +if ( $current_screen->taxonomy ) { |
|
155 | 164 | $admin_body_class .= ' taxonomy-' . $current_screen->taxonomy; |
165 | +} |
|
156 | 166 | |
157 | 167 | $admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) ); |
158 | 168 | $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) ); |
159 | 169 | $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' ); |
160 | 170 | $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); |
161 | 171 | |
162 | -if ( wp_is_mobile() ) |
|
172 | +if ( wp_is_mobile() ) { |
|
163 | 173 | $admin_body_class .= ' mobile'; |
174 | +} |
|
164 | 175 | |
165 | -if ( is_multisite() ) |
|
176 | +if ( is_multisite() ) { |
|
166 | 177 | $admin_body_class .= ' multisite'; |
178 | +} |
|
167 | 179 | |
168 | -if ( is_network_admin() ) |
|
180 | +if ( is_network_admin() ) { |
|
169 | 181 | $admin_body_class .= ' network-admin'; |
182 | +} |
|
170 | 183 | |
171 | 184 | $admin_body_class .= ' no-customize-support no-svg'; |
172 | 185 | |
@@ -257,5 +270,6 @@ discard block |
||
257 | 270 | */ |
258 | 271 | do_action( 'all_admin_notices' ); |
259 | 272 | |
260 | -if ( $parent_file == 'options-general.php' ) |
|
273 | +if ( $parent_file == 'options-general.php' ) { |
|
261 | 274 | require(ABSPATH . 'wp-admin/options-head.php'); |
275 | +} |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * WordPress Administration Template Header |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Administration |
|
7 | - */ |
|
3 | + * WordPress Administration Template Header |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Administration |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); |
10 | 10 | if ( ! defined( 'WP_ADMIN' ) ) |
@@ -207,10 +207,10 @@ discard block |
||
207 | 207 | |
208 | 208 | <?php |
209 | 209 | /** |
210 | - * Fires at the beginning of the content section in an admin page. |
|
211 | - * |
|
212 | - * @since 3.0.0 |
|
213 | - */ |
|
210 | + * Fires at the beginning of the content section in an admin page. |
|
211 | + * |
|
212 | + * @since 3.0.0 |
|
213 | + */ |
|
214 | 214 | do_action( 'in_admin_header' ); |
215 | 215 | ?> |
216 | 216 |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Themes administration panel. |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Administration |
|
7 | - */ |
|
3 | + * Themes administration panel. |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Administration |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | /** WordPress Administration Bootstrap */ |
10 | 10 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
@@ -7,58 +7,58 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | /** WordPress Administration Bootstrap */ |
10 | -require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
10 | +require_once(dirname(__FILE__).'/admin.php'); |
|
11 | 11 | |
12 | -if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) { |
|
12 | +if ( ! current_user_can('switch_themes') && ! current_user_can('edit_theme_options')) { |
|
13 | 13 | wp_die( |
14 | - '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . |
|
15 | - '<p>' . __( 'You are not allowed to edit theme options on this site.' ) . '</p>', |
|
14 | + '<h1>'.__('Cheatin’ uh?').'</h1>'. |
|
15 | + '<p>'.__('You are not allowed to edit theme options on this site.').'</p>', |
|
16 | 16 | 403 |
17 | 17 | ); |
18 | 18 | } |
19 | 19 | |
20 | -if ( current_user_can( 'switch_themes' ) && isset($_GET['action'] ) ) { |
|
21 | - if ( 'activate' == $_GET['action'] ) { |
|
22 | - check_admin_referer('switch-theme_' . $_GET['stylesheet']); |
|
23 | - $theme = wp_get_theme( $_GET['stylesheet'] ); |
|
20 | +if (current_user_can('switch_themes') && isset($_GET['action'])) { |
|
21 | + if ('activate' == $_GET['action']) { |
|
22 | + check_admin_referer('switch-theme_'.$_GET['stylesheet']); |
|
23 | + $theme = wp_get_theme($_GET['stylesheet']); |
|
24 | 24 | |
25 | - if ( ! $theme->exists() || ! $theme->is_allowed() ) { |
|
25 | + if ( ! $theme->exists() || ! $theme->is_allowed()) { |
|
26 | 26 | wp_die( |
27 | - '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . |
|
28 | - '<p>' . __( 'The requested theme does not exist.' ) . '</p>', |
|
27 | + '<h1>'.__('Cheatin’ uh?').'</h1>'. |
|
28 | + '<p>'.__('The requested theme does not exist.').'</p>', |
|
29 | 29 | 403 |
30 | 30 | ); |
31 | 31 | } |
32 | 32 | |
33 | - switch_theme( $theme->get_stylesheet() ); |
|
34 | - wp_redirect( admin_url('themes.php?activated=true') ); |
|
33 | + switch_theme($theme->get_stylesheet()); |
|
34 | + wp_redirect(admin_url('themes.php?activated=true')); |
|
35 | 35 | exit; |
36 | - } elseif ( 'delete' == $_GET['action'] ) { |
|
37 | - check_admin_referer('delete-theme_' . $_GET['stylesheet']); |
|
38 | - $theme = wp_get_theme( $_GET['stylesheet'] ); |
|
36 | + } elseif ('delete' == $_GET['action']) { |
|
37 | + check_admin_referer('delete-theme_'.$_GET['stylesheet']); |
|
38 | + $theme = wp_get_theme($_GET['stylesheet']); |
|
39 | 39 | |
40 | - if ( ! current_user_can( 'delete_themes' ) ) { |
|
40 | + if ( ! current_user_can('delete_themes')) { |
|
41 | 41 | wp_die( |
42 | - '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . |
|
43 | - '<p>' . __( 'You are not allowed to delete this item.' ) . '</p>', |
|
42 | + '<h1>'.__('Cheatin’ uh?').'</h1>'. |
|
43 | + '<p>'.__('You are not allowed to delete this item.').'</p>', |
|
44 | 44 | 403 |
45 | 45 | ); |
46 | 46 | } |
47 | 47 | |
48 | - if ( ! $theme->exists() ) { |
|
48 | + if ( ! $theme->exists()) { |
|
49 | 49 | wp_die( |
50 | - '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . |
|
51 | - '<p>' . __( 'The requested theme does not exist.' ) . '</p>', |
|
50 | + '<h1>'.__('Cheatin’ uh?').'</h1>'. |
|
51 | + '<p>'.__('The requested theme does not exist.').'</p>', |
|
52 | 52 | 403 |
53 | 53 | ); |
54 | 54 | } |
55 | 55 | |
56 | 56 | $active = wp_get_theme(); |
57 | - if ( $active->get( 'Template' ) == $_GET['stylesheet'] ) { |
|
58 | - wp_redirect( admin_url( 'themes.php?delete-active-child=true' ) ); |
|
57 | + if ($active->get('Template') == $_GET['stylesheet']) { |
|
58 | + wp_redirect(admin_url('themes.php?delete-active-child=true')); |
|
59 | 59 | } else { |
60 | - delete_theme( $_GET['stylesheet'] ); |
|
61 | - wp_redirect( admin_url( 'themes.php?deleted=true' ) ); |
|
60 | + delete_theme($_GET['stylesheet']); |
|
61 | + wp_redirect(admin_url('themes.php?deleted=true')); |
|
62 | 62 | } |
63 | 63 | exit; |
64 | 64 | } |
@@ -68,115 +68,115 @@ discard block |
||
68 | 68 | $parent_file = 'themes.php'; |
69 | 69 | |
70 | 70 | // Help tab: Overview |
71 | -if ( current_user_can( 'switch_themes' ) ) { |
|
72 | - $help_overview = '<p>' . __( 'This screen is used for managing your installed themes. Aside from the default theme(s) included with your WordPress installation, themes are designed and developed by third parties.' ) . '</p>' . |
|
73 | - '<p>' . __( 'From this screen you can:' ) . '</p>' . |
|
74 | - '<ul><li>' . __( 'Hover or tap to see Activate and Live Preview buttons' ) . '</li>' . |
|
75 | - '<li>' . __( 'Click on the theme to see the theme name, version, author, description, tags, and the Delete link' ) . '</li>' . |
|
76 | - '<li>' . __( 'Click Customize for the current theme or Live Preview for any other theme to see a live preview' ) . '</li></ul>' . |
|
77 | - '<p>' . __( 'The current theme is displayed highlighted as the first theme.' ) . '</p>' . |
|
78 | - '<p>' . __( 'The search for installed themes will search for terms in their name, description, author, or tag.' ) . ' <span id="live-search-desc">' . __( 'The search results will be updated as you type.' ) . '</span></p>'; |
|
79 | - |
|
80 | - get_current_screen()->add_help_tab( array( |
|
71 | +if (current_user_can('switch_themes')) { |
|
72 | + $help_overview = '<p>'.__('This screen is used for managing your installed themes. Aside from the default theme(s) included with your WordPress installation, themes are designed and developed by third parties.').'</p>'. |
|
73 | + '<p>'.__('From this screen you can:').'</p>'. |
|
74 | + '<ul><li>'.__('Hover or tap to see Activate and Live Preview buttons').'</li>'. |
|
75 | + '<li>'.__('Click on the theme to see the theme name, version, author, description, tags, and the Delete link').'</li>'. |
|
76 | + '<li>'.__('Click Customize for the current theme or Live Preview for any other theme to see a live preview').'</li></ul>'. |
|
77 | + '<p>'.__('The current theme is displayed highlighted as the first theme.').'</p>'. |
|
78 | + '<p>'.__('The search for installed themes will search for terms in their name, description, author, or tag.').' <span id="live-search-desc">'.__('The search results will be updated as you type.').'</span></p>'; |
|
79 | + |
|
80 | + get_current_screen()->add_help_tab(array( |
|
81 | 81 | 'id' => 'overview', |
82 | - 'title' => __( 'Overview' ), |
|
82 | + 'title' => __('Overview'), |
|
83 | 83 | 'content' => $help_overview |
84 | - ) ); |
|
84 | + )); |
|
85 | 85 | } // switch_themes |
86 | 86 | |
87 | 87 | // Help tab: Adding Themes |
88 | -if ( current_user_can( 'install_themes' ) ) { |
|
89 | - if ( is_multisite() ) { |
|
90 | - $help_install = '<p>' . __('Installing themes on Multisite can only be done from the Network Admin section.') . '</p>'; |
|
88 | +if (current_user_can('install_themes')) { |
|
89 | + if (is_multisite()) { |
|
90 | + $help_install = '<p>'.__('Installing themes on Multisite can only be done from the Network Admin section.').'</p>'; |
|
91 | 91 | } else { |
92 | - $help_install = '<p>' . sprintf( __('If you would like to see more themes to choose from, click on the “Add New” button and you will be able to browse or search for additional themes from the <a href="%s" target="_blank">WordPress.org Theme Directory</a>. Themes in the WordPress.org Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they’re free!'), 'https://wordpress.org/themes/' ) . '</p>'; |
|
92 | + $help_install = '<p>'.sprintf(__('If you would like to see more themes to choose from, click on the “Add New” button and you will be able to browse or search for additional themes from the <a href="%s" target="_blank">WordPress.org Theme Directory</a>. Themes in the WordPress.org Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they’re free!'), 'https://wordpress.org/themes/').'</p>'; |
|
93 | 93 | } |
94 | 94 | |
95 | - get_current_screen()->add_help_tab( array( |
|
95 | + get_current_screen()->add_help_tab(array( |
|
96 | 96 | 'id' => 'adding-themes', |
97 | 97 | 'title' => __('Adding Themes'), |
98 | 98 | 'content' => $help_install |
99 | - ) ); |
|
99 | + )); |
|
100 | 100 | } // install_themes |
101 | 101 | |
102 | 102 | // Help tab: Previewing and Customizing |
103 | -if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { |
|
103 | +if (current_user_can('edit_theme_options') && current_user_can('customize')) { |
|
104 | 104 | $help_customize = |
105 | - '<p>' . __( 'Tap or hover on any theme then click the Live Preview button to see a live preview of that theme and change theme options in a separate, full-screen view. You can also find a Live Preview button at the bottom of the theme details screen. Any installed theme can be previewed and customized in this way.' ) . '</p>'. |
|
106 | - '<p>' . __( 'The theme being previewed is fully interactive — navigate to different pages to see how the theme handles posts, archives, and other page templates. The settings may differ depending on what theme features the theme being previewed supports. To accept the new settings and activate the theme all in one step, click the Save & Activate button above the menu.' ) . '</p>' . |
|
107 | - '<p>' . __( 'When previewing on smaller monitors, you can use the collapse icon at the bottom of the left-hand pane. This will hide the pane, giving you more room to preview your site in the new theme. To bring the pane back, click on the collapse icon again.' ) . '</p>'; |
|
105 | + '<p>'.__('Tap or hover on any theme then click the Live Preview button to see a live preview of that theme and change theme options in a separate, full-screen view. You can also find a Live Preview button at the bottom of the theme details screen. Any installed theme can be previewed and customized in this way.').'</p>'. |
|
106 | + '<p>'.__('The theme being previewed is fully interactive — navigate to different pages to see how the theme handles posts, archives, and other page templates. The settings may differ depending on what theme features the theme being previewed supports. To accept the new settings and activate the theme all in one step, click the Save & Activate button above the menu.').'</p>'. |
|
107 | + '<p>'.__('When previewing on smaller monitors, you can use the collapse icon at the bottom of the left-hand pane. This will hide the pane, giving you more room to preview your site in the new theme. To bring the pane back, click on the collapse icon again.').'</p>'; |
|
108 | 108 | |
109 | - get_current_screen()->add_help_tab( array( |
|
109 | + get_current_screen()->add_help_tab(array( |
|
110 | 110 | 'id' => 'customize-preview-themes', |
111 | - 'title' => __( 'Previewing and Customizing' ), |
|
111 | + 'title' => __('Previewing and Customizing'), |
|
112 | 112 | 'content' => $help_customize |
113 | - ) ); |
|
113 | + )); |
|
114 | 114 | } // edit_theme_options && customize |
115 | 115 | |
116 | 116 | get_current_screen()->set_help_sidebar( |
117 | - '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
|
118 | - '<p>' . __( '<a href="https://codex.wordpress.org/Using_Themes" target="_blank">Documentation on Using Themes</a>' ) . '</p>' . |
|
119 | - '<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>' |
|
117 | + '<p><strong>'.__('For more information:').'</strong></p>'. |
|
118 | + '<p>'.__('<a href="https://codex.wordpress.org/Using_Themes" target="_blank">Documentation on Using Themes</a>').'</p>'. |
|
119 | + '<p>'.__('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>').'</p>' |
|
120 | 120 | ); |
121 | 121 | |
122 | -if ( current_user_can( 'switch_themes' ) ) { |
|
122 | +if (current_user_can('switch_themes')) { |
|
123 | 123 | $themes = wp_prepare_themes_for_js(); |
124 | 124 | } else { |
125 | - $themes = wp_prepare_themes_for_js( array( wp_get_theme() ) ); |
|
125 | + $themes = wp_prepare_themes_for_js(array(wp_get_theme())); |
|
126 | 126 | } |
127 | -wp_reset_vars( array( 'theme', 'search' ) ); |
|
127 | +wp_reset_vars(array('theme', 'search')); |
|
128 | 128 | |
129 | -wp_localize_script( 'theme', '_wpThemeSettings', array( |
|
129 | +wp_localize_script('theme', '_wpThemeSettings', array( |
|
130 | 130 | 'themes' => $themes, |
131 | 131 | 'settings' => array( |
132 | - 'canInstall' => ( ! is_multisite() && current_user_can( 'install_themes' ) ), |
|
133 | - 'installURI' => ( ! is_multisite() && current_user_can( 'install_themes' ) ) ? admin_url( 'theme-install.php' ) : null, |
|
134 | - 'confirmDelete' => __( "Are you sure you want to delete this theme?\n\nClick 'Cancel' to go back, 'OK' to confirm the delete." ), |
|
135 | - 'adminUrl' => parse_url( admin_url(), PHP_URL_PATH ), |
|
132 | + 'canInstall' => ( ! is_multisite() && current_user_can('install_themes')), |
|
133 | + 'installURI' => ( ! is_multisite() && current_user_can('install_themes')) ? admin_url('theme-install.php') : null, |
|
134 | + 'confirmDelete' => __("Are you sure you want to delete this theme?\n\nClick 'Cancel' to go back, 'OK' to confirm the delete."), |
|
135 | + 'adminUrl' => parse_url(admin_url(), PHP_URL_PATH), |
|
136 | 136 | ), |
137 | 137 | 'l10n' => array( |
138 | - 'addNew' => __( 'Add New Theme' ), |
|
139 | - 'search' => __( 'Search Installed Themes' ), |
|
140 | - 'searchPlaceholder' => __( 'Search installed themes...' ), // placeholder (no ellipsis) |
|
141 | - 'themesFound' => __( 'Number of Themes found: %d' ), |
|
142 | - 'noThemesFound' => __( 'No themes found. Try a different search.' ), |
|
138 | + 'addNew' => __('Add New Theme'), |
|
139 | + 'search' => __('Search Installed Themes'), |
|
140 | + 'searchPlaceholder' => __('Search installed themes...'), // placeholder (no ellipsis) |
|
141 | + 'themesFound' => __('Number of Themes found: %d'), |
|
142 | + 'noThemesFound' => __('No themes found. Try a different search.'), |
|
143 | 143 | ), |
144 | -) ); |
|
144 | +)); |
|
145 | 145 | |
146 | 146 | add_thickbox(); |
147 | -wp_enqueue_script( 'theme' ); |
|
148 | -wp_enqueue_script( 'customize-loader' ); |
|
147 | +wp_enqueue_script('theme'); |
|
148 | +wp_enqueue_script('customize-loader'); |
|
149 | 149 | |
150 | -require_once( ABSPATH . 'wp-admin/admin-header.php' ); |
|
150 | +require_once(ABSPATH.'wp-admin/admin-header.php'); |
|
151 | 151 | ?> |
152 | 152 | |
153 | 153 | <div class="wrap"> |
154 | - <h1><?php esc_html_e( 'Themes' ); ?> |
|
155 | - <span class="title-count theme-count"><?php echo count( $themes ); ?></span> |
|
156 | - <?php if ( ! is_multisite() && current_user_can( 'install_themes' ) ) : ?> |
|
157 | - <a href="<?php echo admin_url( 'theme-install.php' ); ?>" class="hide-if-no-js page-title-action"><?php echo esc_html_x( 'Add New', 'Add new theme' ); ?></a> |
|
154 | + <h1><?php esc_html_e('Themes'); ?> |
|
155 | + <span class="title-count theme-count"><?php echo count($themes); ?></span> |
|
156 | + <?php if ( ! is_multisite() && current_user_can('install_themes')) : ?> |
|
157 | + <a href="<?php echo admin_url('theme-install.php'); ?>" class="hide-if-no-js page-title-action"><?php echo esc_html_x('Add New', 'Add new theme'); ?></a> |
|
158 | 158 | <?php endif; ?> |
159 | 159 | </h1> |
160 | 160 | <?php |
161 | -if ( ! validate_current_theme() || isset( $_GET['broken'] ) ) : ?> |
|
161 | +if ( ! validate_current_theme() || isset($_GET['broken'])) : ?> |
|
162 | 162 | <div id="message1" class="updated notice is-dismissible"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div> |
163 | -<?php elseif ( isset($_GET['activated']) ) : |
|
164 | - if ( isset( $_GET['previewed'] ) ) { ?> |
|
165 | - <div id="message2" class="updated notice is-dismissible"><p><?php _e( 'Settings saved and theme activated.' ); ?> <a href="<?php echo home_url( '/' ); ?>"><?php _e( 'Visit site' ); ?></a></p></div> |
|
163 | +<?php elseif (isset($_GET['activated'])) : |
|
164 | + if (isset($_GET['previewed'])) { ?> |
|
165 | + <div id="message2" class="updated notice is-dismissible"><p><?php _e('Settings saved and theme activated.'); ?> <a href="<?php echo home_url('/'); ?>"><?php _e('Visit site'); ?></a></p></div> |
|
166 | 166 | <?php } else { ?> |
167 | -<div id="message2" class="updated notice is-dismissible"><p><?php _e( 'New theme activated.' ); ?> <a href="<?php echo home_url( '/' ); ?>"><?php _e( 'Visit site' ); ?></a></p></div><?php |
|
167 | +<div id="message2" class="updated notice is-dismissible"><p><?php _e('New theme activated.'); ?> <a href="<?php echo home_url('/'); ?>"><?php _e('Visit site'); ?></a></p></div><?php |
|
168 | 168 | } |
169 | - elseif ( isset($_GET['deleted']) ) : ?> |
|
169 | + elseif (isset($_GET['deleted'])) : ?> |
|
170 | 170 | <div id="message3" class="updated notice is-dismissible"><p><?php _e('Theme deleted.') ?></p></div> |
171 | -<?php elseif ( isset( $_GET['delete-active-child'] ) ) : ?> |
|
172 | - <div id="message4" class="error"><p><?php _e( 'You cannot delete a theme while it has an active child theme.' ); ?></p></div> |
|
171 | +<?php elseif (isset($_GET['delete-active-child'])) : ?> |
|
172 | + <div id="message4" class="error"><p><?php _e('You cannot delete a theme while it has an active child theme.'); ?></p></div> |
|
173 | 173 | <?php |
174 | 174 | endif; |
175 | 175 | |
176 | 176 | $ct = wp_get_theme(); |
177 | 177 | |
178 | -if ( $ct->errors() && ( ! is_multisite() || current_user_can( 'manage_network_themes' ) ) ) { |
|
179 | - echo '<div class="error"><p>' . sprintf( __( 'ERROR: %s' ), $ct->errors()->get_error_message() ) . '</p></div>'; |
|
178 | +if ($ct->errors() && ( ! is_multisite() || current_user_can('manage_network_themes'))) { |
|
179 | + echo '<div class="error"><p>'.sprintf(__('ERROR: %s'), $ct->errors()->get_error_message()).'</p></div>'; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /* |
@@ -187,37 +187,37 @@ discard block |
||
187 | 187 | |
188 | 188 | // Pretend you didn't see this. |
189 | 189 | $current_theme_actions = array(); |
190 | - if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) { |
|
191 | - foreach ( (array) $submenu['themes.php'] as $item) { |
|
190 | + if (is_array($submenu) && isset($submenu['themes.php'])) { |
|
191 | + foreach ((array) $submenu['themes.php'] as $item) { |
|
192 | 192 | $class = ''; |
193 | - if ( 'themes.php' == $item[2] || 'theme-editor.php' == $item[2] || 0 === strpos( $item[2], 'customize.php' ) ) |
|
193 | + if ('themes.php' == $item[2] || 'theme-editor.php' == $item[2] || 0 === strpos($item[2], 'customize.php')) |
|
194 | 194 | continue; |
195 | 195 | // 0 = name, 1 = capability, 2 = file |
196 | - if ( ( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file)) ) |
|
196 | + if ((strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) |
|
197 | 197 | $class = ' current'; |
198 | - if ( !empty($submenu[$item[2]]) ) { |
|
198 | + if ( ! empty($submenu[$item[2]])) { |
|
199 | 199 | $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. |
200 | 200 | $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); |
201 | - if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) |
|
201 | + if (file_exists(WP_PLUGIN_DIR."/{$submenu[$item[2]][0][2]}") || ! empty($menu_hook)) |
|
202 | 202 | $current_theme_actions[] = "<a class='button button-secondary$class' href='admin.php?page={$submenu[$item[2]][0][2]}'>{$item[0]}</a>"; |
203 | 203 | else |
204 | 204 | $current_theme_actions[] = "<a class='button button-secondary$class' href='{$submenu[$item[2]][0][2]}'>{$item[0]}</a>"; |
205 | - } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) { |
|
205 | + } elseif ( ! empty($item[2]) && current_user_can($item[1])) { |
|
206 | 206 | $menu_file = $item[2]; |
207 | 207 | |
208 | - if ( current_user_can( 'customize' ) ) { |
|
209 | - if ( 'custom-header' === $menu_file ) { |
|
208 | + if (current_user_can('customize')) { |
|
209 | + if ('custom-header' === $menu_file) { |
|
210 | 210 | $current_theme_actions[] = "<a class='button button-secondary hide-if-no-customize$class' href='customize.php?autofocus[control]=header_image'>{$item[0]}</a>"; |
211 | - } elseif ( 'custom-background' === $menu_file ) { |
|
211 | + } elseif ('custom-background' === $menu_file) { |
|
212 | 212 | $current_theme_actions[] = "<a class='button button-secondary hide-if-no-customize$class' href='customize.php?autofocus[control]=background_image'>{$item[0]}</a>"; |
213 | 213 | } |
214 | 214 | } |
215 | 215 | |
216 | - if ( false !== ( $pos = strpos( $menu_file, '?' ) ) ) { |
|
217 | - $menu_file = substr( $menu_file, 0, $pos ); |
|
216 | + if (false !== ($pos = strpos($menu_file, '?'))) { |
|
217 | + $menu_file = substr($menu_file, 0, $pos); |
|
218 | 218 | } |
219 | 219 | |
220 | - if ( file_exists( ABSPATH . "wp-admin/$menu_file" ) ) { |
|
220 | + if (file_exists(ABSPATH."wp-admin/$menu_file")) { |
|
221 | 221 | $current_theme_actions[] = "<a class='button button-secondary$class' href='{$item[2]}'>{$item[0]}</a>"; |
222 | 222 | } else { |
223 | 223 | $current_theme_actions[] = "<a class='button button-secondary$class' href='themes.php?page={$item[2]}'>{$item[0]}</a>"; |
@@ -236,26 +236,26 @@ discard block |
||
236 | 236 | * This PHP is synchronized with the tmpl-theme template below! |
237 | 237 | */ |
238 | 238 | |
239 | -foreach ( $themes as $theme ) : |
|
240 | - $aria_action = esc_attr( $theme['id'] . '-action' ); |
|
241 | - $aria_name = esc_attr( $theme['id'] . '-name' ); |
|
239 | +foreach ($themes as $theme) : |
|
240 | + $aria_action = esc_attr($theme['id'].'-action'); |
|
241 | + $aria_name = esc_attr($theme['id'].'-name'); |
|
242 | 242 | ?> |
243 | -<div class="theme<?php if ( $theme['active'] ) echo ' active'; ?>" tabindex="0" aria-describedby="<?php echo $aria_action . ' ' . $aria_name; ?>"> |
|
244 | - <?php if ( ! empty( $theme['screenshot'][0] ) ) { ?> |
|
243 | +<div class="theme<?php if ($theme['active']) echo ' active'; ?>" tabindex="0" aria-describedby="<?php echo $aria_action.' '.$aria_name; ?>"> |
|
244 | + <?php if ( ! empty($theme['screenshot'][0])) { ?> |
|
245 | 245 | <div class="theme-screenshot"> |
246 | 246 | <img src="<?php echo $theme['screenshot'][0]; ?>" alt="" /> |
247 | 247 | </div> |
248 | 248 | <?php } else { ?> |
249 | 249 | <div class="theme-screenshot blank"></div> |
250 | 250 | <?php } ?> |
251 | - <span class="more-details" id="<?php echo $aria_action; ?>"><?php _e( 'Theme Details' ); ?></span> |
|
252 | - <div class="theme-author"><?php printf( __( 'By %s' ), $theme['author'] ); ?></div> |
|
251 | + <span class="more-details" id="<?php echo $aria_action; ?>"><?php _e('Theme Details'); ?></span> |
|
252 | + <div class="theme-author"><?php printf(__('By %s'), $theme['author']); ?></div> |
|
253 | 253 | |
254 | - <?php if ( $theme['active'] ) { ?> |
|
254 | + <?php if ($theme['active']) { ?> |
|
255 | 255 | <h2 class="theme-name" id="<?php echo $aria_name; ?>"> |
256 | 256 | <?php |
257 | 257 | /* translators: %s: theme name */ |
258 | - printf( __( '<span>Active:</span> %s' ), $theme['name'] ); |
|
258 | + printf(__('<span>Active:</span> %s'), $theme['name']); |
|
259 | 259 | ?> |
260 | 260 | </h2> |
261 | 261 | <?php } else { ?> |
@@ -264,21 +264,21 @@ discard block |
||
264 | 264 | |
265 | 265 | <div class="theme-actions"> |
266 | 266 | |
267 | - <?php if ( $theme['active'] ) { ?> |
|
268 | - <?php if ( $theme['actions']['customize'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?> |
|
269 | - <a class="button button-primary customize load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Customize' ); ?></a> |
|
267 | + <?php if ($theme['active']) { ?> |
|
268 | + <?php if ($theme['actions']['customize'] && current_user_can('edit_theme_options') && current_user_can('customize')) { ?> |
|
269 | + <a class="button button-primary customize load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e('Customize'); ?></a> |
|
270 | 270 | <?php } ?> |
271 | 271 | <?php } else { ?> |
272 | - <a class="button button-secondary activate" href="<?php echo $theme['actions']['activate']; ?>"><?php _e( 'Activate' ); ?></a> |
|
273 | - <?php if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?> |
|
274 | - <a class="button button-primary load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Live Preview' ); ?></a> |
|
272 | + <a class="button button-secondary activate" href="<?php echo $theme['actions']['activate']; ?>"><?php _e('Activate'); ?></a> |
|
273 | + <?php if (current_user_can('edit_theme_options') && current_user_can('customize')) { ?> |
|
274 | + <a class="button button-primary load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e('Live Preview'); ?></a> |
|
275 | 275 | <?php } ?> |
276 | 276 | <?php } ?> |
277 | 277 | |
278 | 278 | </div> |
279 | 279 | |
280 | - <?php if ( $theme['hasUpdate'] ) { ?> |
|
281 | - <div class="theme-update"><?php _e( 'Update Available' ); ?></div> |
|
280 | + <?php if ($theme['hasUpdate']) { ?> |
|
281 | + <div class="theme-update"><?php _e('Update Available'); ?></div> |
|
282 | 282 | <?php } ?> |
283 | 283 | </div> |
284 | 284 | <?php endforeach; ?> |
@@ -286,61 +286,61 @@ discard block |
||
286 | 286 | </div> |
287 | 287 | <div class="theme-overlay"></div> |
288 | 288 | |
289 | -<p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p> |
|
289 | +<p class="no-themes"><?php _e('No themes found. Try a different search.'); ?></p> |
|
290 | 290 | |
291 | 291 | <?php |
292 | 292 | // List broken themes, if any. |
293 | -if ( ! is_multisite() && current_user_can('edit_themes') && $broken_themes = wp_get_themes( array( 'errors' => true ) ) ) { |
|
293 | +if ( ! is_multisite() && current_user_can('edit_themes') && $broken_themes = wp_get_themes(array('errors' => true))) { |
|
294 | 294 | ?> |
295 | 295 | |
296 | 296 | <div class="broken-themes"> |
297 | 297 | <h3><?php _e('Broken Themes'); ?></h3> |
298 | -<p><?php _e( 'The following themes are installed but incomplete.' ); ?></p> |
|
298 | +<p><?php _e('The following themes are installed but incomplete.'); ?></p> |
|
299 | 299 | |
300 | 300 | <?php |
301 | -$can_delete = current_user_can( 'delete_themes' ); |
|
302 | -$can_install = current_user_can( 'install_themes' ); |
|
301 | +$can_delete = current_user_can('delete_themes'); |
|
302 | +$can_install = current_user_can('install_themes'); |
|
303 | 303 | ?> |
304 | 304 | <table> |
305 | 305 | <tr> |
306 | 306 | <th><?php _ex('Name', 'theme name'); ?></th> |
307 | 307 | <th><?php _e('Description'); ?></th> |
308 | - <?php if ( $can_delete ) { ?> |
|
308 | + <?php if ($can_delete) { ?> |
|
309 | 309 | <td></td> |
310 | 310 | <?php } ?> |
311 | - <?php if ( $can_install ) { ?> |
|
311 | + <?php if ($can_install) { ?> |
|
312 | 312 | <td></td> |
313 | 313 | <?php } ?> |
314 | 314 | </tr> |
315 | - <?php foreach ( $broken_themes as $broken_theme ) : ?> |
|
315 | + <?php foreach ($broken_themes as $broken_theme) : ?> |
|
316 | 316 | <tr> |
317 | - <td><?php echo $broken_theme->get( 'Name' ) ? $broken_theme->display( 'Name' ) : $broken_theme->get_stylesheet(); ?></td> |
|
317 | + <td><?php echo $broken_theme->get('Name') ? $broken_theme->display('Name') : $broken_theme->get_stylesheet(); ?></td> |
|
318 | 318 | <td><?php echo $broken_theme->errors()->get_error_message(); ?></td> |
319 | 319 | <?php |
320 | - if ( $can_delete ) { |
|
320 | + if ($can_delete) { |
|
321 | 321 | $stylesheet = $broken_theme->get_stylesheet(); |
322 | - $delete_url = add_query_arg( array( |
|
322 | + $delete_url = add_query_arg(array( |
|
323 | 323 | 'action' => 'delete', |
324 | - 'stylesheet' => urlencode( $stylesheet ), |
|
325 | - ), admin_url( 'themes.php' ) ); |
|
326 | - $delete_url = wp_nonce_url( $delete_url, 'delete-theme_' . $stylesheet ); |
|
324 | + 'stylesheet' => urlencode($stylesheet), |
|
325 | + ), admin_url('themes.php')); |
|
326 | + $delete_url = wp_nonce_url($delete_url, 'delete-theme_'.$stylesheet); |
|
327 | 327 | ?> |
328 | - <td><a href="<?php echo esc_url( $delete_url ); ?>" class="button button-secondary delete-theme"><?php _e( 'Delete' ); ?></a></td> |
|
328 | + <td><a href="<?php echo esc_url($delete_url); ?>" class="button button-secondary delete-theme"><?php _e('Delete'); ?></a></td> |
|
329 | 329 | <?php |
330 | 330 | } |
331 | 331 | |
332 | - if ( $can_install && 'theme_no_parent' === $broken_theme->errors()->get_error_code() ) { |
|
333 | - $parent_theme_name = $broken_theme->get( 'Template' ); |
|
334 | - $parent_theme = themes_api( 'theme_information', array( 'slug' => urlencode( $parent_theme_name ) ) ); |
|
332 | + if ($can_install && 'theme_no_parent' === $broken_theme->errors()->get_error_code()) { |
|
333 | + $parent_theme_name = $broken_theme->get('Template'); |
|
334 | + $parent_theme = themes_api('theme_information', array('slug' => urlencode($parent_theme_name))); |
|
335 | 335 | |
336 | - if ( ! is_wp_error( $parent_theme ) ) { |
|
337 | - $install_url = add_query_arg( array( |
|
336 | + if ( ! is_wp_error($parent_theme)) { |
|
337 | + $install_url = add_query_arg(array( |
|
338 | 338 | 'action' => 'install-theme', |
339 | - 'theme' => urlencode( $parent_theme_name ), |
|
340 | - ), admin_url( 'update.php' ) ); |
|
341 | - $install_url = wp_nonce_url( $install_url, 'install-theme_' . $parent_theme_name ); |
|
339 | + 'theme' => urlencode($parent_theme_name), |
|
340 | + ), admin_url('update.php')); |
|
341 | + $install_url = wp_nonce_url($install_url, 'install-theme_'.$parent_theme_name); |
|
342 | 342 | ?> |
343 | - <td><a href="<?php echo esc_url( $install_url ); ?>" class="button button-secondary install-theme"><?php _e( 'Install Parent Theme' ); ?></a></td> |
|
343 | + <td><a href="<?php echo esc_url($install_url); ?>" class="button button-secondary install-theme"><?php _e('Install Parent Theme'); ?></a></td> |
|
344 | 344 | <?php |
345 | 345 | } |
346 | 346 | } |
@@ -368,14 +368,14 @@ discard block |
||
368 | 368 | <# } else { #> |
369 | 369 | <div class="theme-screenshot blank"></div> |
370 | 370 | <# } #> |
371 | - <span class="more-details" id="{{ data.id }}-action"><?php _e( 'Theme Details' ); ?></span> |
|
372 | - <div class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.author }}}' ); ?></div> |
|
371 | + <span class="more-details" id="{{ data.id }}-action"><?php _e('Theme Details'); ?></span> |
|
372 | + <div class="theme-author"><?php printf(__('By %s'), '{{{ data.author }}}'); ?></div> |
|
373 | 373 | |
374 | 374 | <# if ( data.active ) { #> |
375 | 375 | <h2 class="theme-name" id="{{ data.id }}-name"> |
376 | 376 | <?php |
377 | 377 | /* translators: %s: theme name */ |
378 | - printf( __( '<span>Active:</span> %s' ), '{{{ data.name }}}' ); |
|
378 | + printf(__('<span>Active:</span> %s'), '{{{ data.name }}}'); |
|
379 | 379 | ?> |
380 | 380 | </h2> |
381 | 381 | <# } else { #> |
@@ -386,17 +386,17 @@ discard block |
||
386 | 386 | |
387 | 387 | <# if ( data.active ) { #> |
388 | 388 | <# if ( data.actions.customize ) { #> |
389 | - <a class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Customize' ); ?></a> |
|
389 | + <a class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e('Customize'); ?></a> |
|
390 | 390 | <# } #> |
391 | 391 | <# } else { #> |
392 | - <a class="button button-secondary activate" href="{{{ data.actions.activate }}}"><?php _e( 'Activate' ); ?></a> |
|
393 | - <a class="button button-primary load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Live Preview' ); ?></a> |
|
392 | + <a class="button button-secondary activate" href="{{{ data.actions.activate }}}"><?php _e('Activate'); ?></a> |
|
393 | + <a class="button button-primary load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e('Live Preview'); ?></a> |
|
394 | 394 | <# } #> |
395 | 395 | |
396 | 396 | </div> |
397 | 397 | |
398 | 398 | <# if ( data.hasUpdate ) { #> |
399 | - <div class="theme-update"><?php _e( 'Update Available' ); ?></div> |
|
399 | + <div class="theme-update"><?php _e('Update Available'); ?></div> |
|
400 | 400 | <# } #> |
401 | 401 | </script> |
402 | 402 | |
@@ -404,9 +404,9 @@ discard block |
||
404 | 404 | <div class="theme-backdrop"></div> |
405 | 405 | <div class="theme-wrap wp-clearfix"> |
406 | 406 | <div class="theme-header"> |
407 | - <button class="left dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show previous theme' ); ?></span></button> |
|
408 | - <button class="right dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show next theme' ); ?></span></button> |
|
409 | - <button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close details dialog' ); ?></span></button> |
|
407 | + <button class="left dashicons dashicons-no"><span class="screen-reader-text"><?php _e('Show previous theme'); ?></span></button> |
|
408 | + <button class="right dashicons dashicons-no"><span class="screen-reader-text"><?php _e('Show next theme'); ?></span></button> |
|
409 | + <button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e('Close details dialog'); ?></span></button> |
|
410 | 410 | </div> |
411 | 411 | <div class="theme-about wp-clearfix"> |
412 | 412 | <div class="theme-screenshots"> |
@@ -419,46 +419,46 @@ discard block |
||
419 | 419 | |
420 | 420 | <div class="theme-info"> |
421 | 421 | <# if ( data.active ) { #> |
422 | - <span class="current-label"><?php _e( 'Current Theme' ); ?></span> |
|
422 | + <span class="current-label"><?php _e('Current Theme'); ?></span> |
|
423 | 423 | <# } #> |
424 | - <h2 class="theme-name">{{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s' ), '{{ data.version }}' ); ?></span></h2> |
|
425 | - <p class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' ); ?></p> |
|
424 | + <h2 class="theme-name">{{{ data.name }}}<span class="theme-version"><?php printf(__('Version: %s'), '{{ data.version }}'); ?></span></h2> |
|
425 | + <p class="theme-author"><?php printf(__('By %s'), '{{{ data.authorAndUri }}}'); ?></p> |
|
426 | 426 | |
427 | 427 | <# if ( data.hasUpdate ) { #> |
428 | 428 | <div class="notice notice-warning notice-alt notice-large"> |
429 | - <h3 class="notice-title"><?php _e( 'Update Available' ); ?></h3> |
|
429 | + <h3 class="notice-title"><?php _e('Update Available'); ?></h3> |
|
430 | 430 | {{{ data.update }}} |
431 | 431 | </div> |
432 | 432 | <# } #> |
433 | 433 | <p class="theme-description">{{{ data.description }}}</p> |
434 | 434 | |
435 | 435 | <# if ( data.parent ) { #> |
436 | - <p class="parent-theme"><?php printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' ); ?></p> |
|
436 | + <p class="parent-theme"><?php printf(__('This is a child theme of %s.'), '<strong>{{{ data.parent }}}</strong>'); ?></p> |
|
437 | 437 | <# } #> |
438 | 438 | |
439 | 439 | <# if ( data.tags ) { #> |
440 | - <p class="theme-tags"><span><?php _e( 'Tags:' ); ?></span> {{{ data.tags }}}</p> |
|
440 | + <p class="theme-tags"><span><?php _e('Tags:'); ?></span> {{{ data.tags }}}</p> |
|
441 | 441 | <# } #> |
442 | 442 | </div> |
443 | 443 | </div> |
444 | 444 | |
445 | 445 | <div class="theme-actions"> |
446 | 446 | <div class="active-theme"> |
447 | - <a href="{{{ data.actions.customize }}}" class="button button-primary customize load-customize hide-if-no-customize"><?php _e( 'Customize' ); ?></a> |
|
448 | - <?php echo implode( ' ', $current_theme_actions ); ?> |
|
447 | + <a href="{{{ data.actions.customize }}}" class="button button-primary customize load-customize hide-if-no-customize"><?php _e('Customize'); ?></a> |
|
448 | + <?php echo implode(' ', $current_theme_actions); ?> |
|
449 | 449 | </div> |
450 | 450 | <div class="inactive-theme"> |
451 | 451 | <# if ( data.actions.activate ) { #> |
452 | - <a href="{{{ data.actions.activate }}}" class="button button-secondary activate"><?php _e( 'Activate' ); ?></a> |
|
452 | + <a href="{{{ data.actions.activate }}}" class="button button-secondary activate"><?php _e('Activate'); ?></a> |
|
453 | 453 | <# } #> |
454 | - <a href="{{{ data.actions.customize }}}" class="button button-primary load-customize hide-if-no-customize"><?php _e( 'Live Preview' ); ?></a> |
|
454 | + <a href="{{{ data.actions.customize }}}" class="button button-primary load-customize hide-if-no-customize"><?php _e('Live Preview'); ?></a> |
|
455 | 455 | </div> |
456 | 456 | |
457 | 457 | <# if ( ! data.active && data.actions['delete'] ) { #> |
458 | - <a href="{{{ data.actions['delete'] }}}" class="button button-secondary delete-theme"><?php _e( 'Delete' ); ?></a> |
|
458 | + <a href="{{{ data.actions['delete'] }}}" class="button button-secondary delete-theme"><?php _e('Delete'); ?></a> |
|
459 | 459 | <# } #> |
460 | 460 | </div> |
461 | 461 | </div> |
462 | 462 | </script> |
463 | 463 | |
464 | -<?php require( ABSPATH . 'wp-admin/admin-footer.php' ); |
|
464 | +<?php require(ABSPATH.'wp-admin/admin-footer.php'); |
@@ -165,8 +165,7 @@ discard block |
||
165 | 165 | <div id="message2" class="updated notice is-dismissible"><p><?php _e( 'Settings saved and theme activated.' ); ?> <a href="<?php echo home_url( '/' ); ?>"><?php _e( 'Visit site' ); ?></a></p></div> |
166 | 166 | <?php } else { ?> |
167 | 167 | <div id="message2" class="updated notice is-dismissible"><p><?php _e( 'New theme activated.' ); ?> <a href="<?php echo home_url( '/' ); ?>"><?php _e( 'Visit site' ); ?></a></p></div><?php |
168 | - } |
|
169 | - elseif ( isset($_GET['deleted']) ) : ?> |
|
168 | + } elseif ( isset($_GET['deleted']) ) : ?> |
|
170 | 169 | <div id="message3" class="updated notice is-dismissible"><p><?php _e('Theme deleted.') ?></p></div> |
171 | 170 | <?php elseif ( isset( $_GET['delete-active-child'] ) ) : ?> |
172 | 171 | <div id="message4" class="error"><p><?php _e( 'You cannot delete a theme while it has an active child theme.' ); ?></p></div> |
@@ -190,18 +189,21 @@ discard block |
||
190 | 189 | if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) { |
191 | 190 | foreach ( (array) $submenu['themes.php'] as $item) { |
192 | 191 | $class = ''; |
193 | - if ( 'themes.php' == $item[2] || 'theme-editor.php' == $item[2] || 0 === strpos( $item[2], 'customize.php' ) ) |
|
194 | - continue; |
|
192 | + if ( 'themes.php' == $item[2] || 'theme-editor.php' == $item[2] || 0 === strpos( $item[2], 'customize.php' ) ) { |
|
193 | + continue; |
|
194 | + } |
|
195 | 195 | // 0 = name, 1 = capability, 2 = file |
196 | - if ( ( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file)) ) |
|
197 | - $class = ' current'; |
|
196 | + if ( ( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file)) ) { |
|
197 | + $class = ' current'; |
|
198 | + } |
|
198 | 199 | if ( !empty($submenu[$item[2]]) ) { |
199 | 200 | $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. |
200 | 201 | $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); |
201 | - if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) |
|
202 | - $current_theme_actions[] = "<a class='button button-secondary$class' href='admin.php?page={$submenu[$item[2]][0][2]}'>{$item[0]}</a>"; |
|
203 | - else |
|
204 | - $current_theme_actions[] = "<a class='button button-secondary$class' href='{$submenu[$item[2]][0][2]}'>{$item[0]}</a>"; |
|
202 | + if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) { |
|
203 | + $current_theme_actions[] = "<a class='button button-secondary$class' href='admin.php?page={$submenu[$item[2]][0][2]}'>{$item[0]}</a>"; |
|
204 | + } else { |
|
205 | + $current_theme_actions[] = "<a class='button button-secondary$class' href='{$submenu[$item[2]][0][2]}'>{$item[0]}</a>"; |
|
206 | + } |
|
205 | 207 | } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) { |
206 | 208 | $menu_file = $item[2]; |
207 | 209 | |
@@ -240,7 +242,10 @@ discard block |
||
240 | 242 | $aria_action = esc_attr( $theme['id'] . '-action' ); |
241 | 243 | $aria_name = esc_attr( $theme['id'] . '-name' ); |
242 | 244 | ?> |
243 | -<div class="theme<?php if ( $theme['active'] ) echo ' active'; ?>" tabindex="0" aria-describedby="<?php echo $aria_action . ' ' . $aria_name; ?>"> |
|
245 | +<div class="theme<?php if ( $theme['active'] ) { |
|
246 | + echo ' active'; |
|
247 | +} |
|
248 | +?>" tabindex="0" aria-describedby="<?php echo $aria_action . ' ' . $aria_name; ?>"> |
|
244 | 249 | <?php if ( ! empty( $theme['screenshot'][0] ) ) { ?> |
245 | 250 | <div class="theme-screenshot"> |
246 | 251 | <img src="<?php echo $theme['screenshot'][0]; ?>" alt="" /> |
@@ -15,4 +15,4 @@ |
||
15 | 15 | define('IS_PROFILE_PAGE', true); |
16 | 16 | |
17 | 17 | /** Load User Editing Page */ |
18 | -require_once( dirname( __FILE__ ) . '/user-edit.php' ); |
|
18 | +require_once(dirname(__FILE__).'/user-edit.php'); |