equal
deleted
inserted
replaced
249 'RequiresPHP' => __( 'Required PHP version' ), |
249 'RequiresPHP' => __( 'Required PHP version' ), |
250 'Template' => __( 'Parent theme' ), |
250 'Template' => __( 'Parent theme' ), |
251 ); |
251 ); |
252 |
252 |
253 $table = '<table class="update-from-upload-comparison"><tbody>'; |
253 $table = '<table class="update-from-upload-comparison"><tbody>'; |
254 $table .= '<tr><th></th><th>' . esc_html_x( 'Active', 'theme' ) . '</th><th>' . esc_html_x( 'Uploaded', 'theme' ) . '</th></tr>'; |
254 $table .= '<tr><th></th><th>' . esc_html_x( 'Installed', 'theme' ) . '</th><th>' . esc_html_x( 'Uploaded', 'theme' ) . '</th></tr>'; |
255 |
255 |
256 $is_same_theme = true; // Let's consider only these rows. |
256 $is_same_theme = true; // Let's consider only these rows. |
257 |
257 |
258 foreach ( $rows as $field => $label ) { |
258 foreach ( $rows as $field => $label ) { |
259 $old_value = $current_theme_data->display( $field, false ); |
259 $old_value = $current_theme_data->display( $field, false ); |
317 |
317 |
318 if ( ! is_wp_version_compatible( $requires_wp ) ) { |
318 if ( ! is_wp_version_compatible( $requires_wp ) ) { |
319 $error = sprintf( |
319 $error = sprintf( |
320 /* translators: 1: Current WordPress version, 2: Version required by the uploaded theme. */ |
320 /* translators: 1: Current WordPress version, 2: Version required by the uploaded theme. */ |
321 __( 'Your WordPress version is %1$s, however the uploaded theme requires %2$s.' ), |
321 __( 'Your WordPress version is %1$s, however the uploaded theme requires %2$s.' ), |
322 get_bloginfo( 'version' ), |
322 esc_html( wp_get_wp_version() ), |
323 $requires_wp |
323 $requires_wp |
324 ); |
324 ); |
325 |
325 |
326 $blocked_message .= '<li>' . esc_html( $error ) . '</li>'; |
326 $blocked_message .= '<li>' . esc_html( $error ) . '</li>'; |
327 $can_update = false; |
327 $can_update = false; |
331 |
331 |
332 if ( $can_update ) { |
332 if ( $can_update ) { |
333 if ( $this->is_downgrading ) { |
333 if ( $this->is_downgrading ) { |
334 $warning = sprintf( |
334 $warning = sprintf( |
335 /* translators: %s: Documentation URL. */ |
335 /* translators: %s: Documentation URL. */ |
336 __( 'You are uploading an older version of the active theme. You can continue to install the older version, but be sure to <a href="%s">back up your database and files</a> first.' ), |
336 __( 'You are uploading an older version of the installed theme. You can continue to install the older version, but be sure to <a href="%s">back up your database and files</a> first.' ), |
337 __( 'https://developer.wordpress.org/advanced-administration/security/backup/' ) |
337 __( 'https://developer.wordpress.org/advanced-administration/security/backup/' ) |
338 ); |
338 ); |
339 } else { |
339 } else { |
340 $warning = sprintf( |
340 $warning = sprintf( |
341 /* translators: %s: Documentation URL. */ |
341 /* translators: %s: Documentation URL. */ |
349 $overwrite = $this->is_downgrading ? 'downgrade-theme' : 'update-theme'; |
349 $overwrite = $this->is_downgrading ? 'downgrade-theme' : 'update-theme'; |
350 |
350 |
351 $install_actions['overwrite_theme'] = sprintf( |
351 $install_actions['overwrite_theme'] = sprintf( |
352 '<a class="button button-primary update-from-upload-overwrite" href="%s" target="_parent">%s</a>', |
352 '<a class="button button-primary update-from-upload-overwrite" href="%s" target="_parent">%s</a>', |
353 wp_nonce_url( add_query_arg( 'overwrite', $overwrite, $this->url ), 'theme-upload' ), |
353 wp_nonce_url( add_query_arg( 'overwrite', $overwrite, $this->url ), 'theme-upload' ), |
354 _x( 'Replace active with uploaded', 'theme' ) |
354 _x( 'Replace installed with uploaded', 'theme' ) |
355 ); |
355 ); |
356 } else { |
356 } else { |
357 echo $blocked_message; |
357 echo $blocked_message; |
358 } |
358 } |
359 |
359 |