- Timestamp:
- 07/13/2020 01:33:32 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-theme-installer-skin.php
r48453 r48455 208 208 } 209 209 210 if ( empty( $current_theme_data ) || empty( $this->upgrader->new_theme_data ) ) { 210 $new_theme_data = $this->upgrader->new_theme_data; 211 212 if ( ! $current_theme_data || ! $new_theme_data ) { 211 213 return false; 212 214 } … … 219 221 } 220 222 221 $this->is_downgrading = version_compare( $current_theme_data['Version'], $ this->upgrader->new_theme_data['Version'], '>' );223 $this->is_downgrading = version_compare( $current_theme_data['Version'], $new_theme_data['Version'], '>' ); 222 224 223 225 $is_invalid_parent = false; 224 if ( ! empty( $ this->upgrader->new_theme_data['Template'] ) ) {225 $is_invalid_parent = ! in_array( $ this->upgrader->new_theme_data['Template'], array_keys( $all_themes ), true );226 if ( ! empty( $new_theme_data['Template'] ) ) { 227 $is_invalid_parent = ! in_array( $new_theme_data['Template'], array_keys( $all_themes ), true ); 226 228 } 227 229 … … 244 246 $old_value = $old_value ? (string) $old_value : '-'; 245 247 246 $new_value = ! empty( $ this->upgrader->new_theme_data[ $field ] ) ? (string) $this->upgrader->new_theme_data[ $field ] : '-';248 $new_value = ! empty( $new_theme_data[ $field ] ) ? (string) $new_theme_data[ $field ] : '-'; 247 249 248 250 if ( $old_value === $new_value && '-' === $new_value && 'Template' === $field ) { … … 277 279 * @param array $new_theme_data Array with uploaded theme data. 278 280 */ 279 echo apply_filters( 'install_theme_overwrite_comparison', $table, $current_theme_data, $ this->upgrader->new_theme_data );281 echo apply_filters( 'install_theme_overwrite_comparison', $table, $current_theme_data, $new_theme_data ); 280 282 281 283 $install_actions = array(); … … 285 287 $blocked_message .= '<ul class="ul-disc">'; 286 288 287 if ( ! empty( $this->upgrader->new_theme_data['RequiresPHP'] ) 288 && ! is_php_version_compatible( $this->upgrader->new_theme_data['RequiresPHP'] ) 289 ) { 289 $requires_php = isset( $new_theme_data['RequiresPHP'] ) ? $new_theme_data['RequiresPHP'] : null; 290 $requires_wp = isset( $new_theme_data['RequiresWP'] ) ? $new_theme_data['RequiresWP'] : null; 291 292 if ( ! is_php_version_compatible( $requires_php ) ) { 290 293 $error = sprintf( 291 294 /* translators: 1: Current PHP version, 2: Version required by the uploaded theme. */ 292 295 __( 'The PHP version on your server is %1$s, however the uploaded theme requires %2$s.' ), 293 296 phpversion(), 294 $ this->upgrader->new_theme_data['RequiresPHP']297 $requires_php 295 298 ); 296 299 … … 299 302 } 300 303 301 if ( ! empty( $this->upgrader->new_theme_data['RequiresWP'] ) 302 && ! is_wp_version_compatible( $this->upgrader->new_theme_data['RequiresWP'] ) 303 ) { 304 if ( ! is_wp_version_compatible( $requires_wp ) ) { 304 305 $error = sprintf( 305 306 /* translators: 1: Current WordPress version, 2: Version required by the uploaded theme. */ 306 307 __( 'Your WordPress version is %1$s, however the uploaded theme requires %2$s.' ), 307 $GLOBALS['wp_version'],308 $ this->upgrader->new_theme_data['RequiresWP']308 get_bloginfo( 'version' ), 309 $requires_wp 309 310 ); 310 311 … … 360 361 * @param array $new_theme_data Array with uploaded theme data. 361 362 */ 362 $install_actions = apply_filters( 'install_theme_ovewrite_actions', $install_actions, $this->api, $ this->upgrader->new_theme_data );363 $install_actions = apply_filters( 'install_theme_ovewrite_actions', $install_actions, $this->api, $new_theme_data ); 363 364 364 365 if ( ! empty( $install_actions ) ) { … … 372 373 return true; 373 374 } 374 375 375 }
Note: See TracChangeset
for help on using the changeset viewer.