mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 14:50:29 +00:00
Themes: Prevent installation of themes that require a higher version of PHP or WordPress.
Props afragen. Fixes #49653. See #48491. git-svn-id: https://develop.svn.wordpress.org/trunk@47819 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -5853,9 +5853,11 @@ final class WP_Customize_Manager {
|
||||
$theme->active = ( isset( $_POST['customized_theme'] ) && $_POST['customized_theme'] === $theme->slug );
|
||||
|
||||
// Map available theme properties to installed theme properties.
|
||||
$theme->id = $theme->slug;
|
||||
$theme->screenshot = array( $theme->screenshot_url );
|
||||
$theme->authorAndUri = wp_kses( $theme->author['display_name'], $themes_allowedtags );
|
||||
$theme->id = $theme->slug;
|
||||
$theme->screenshot = array( $theme->screenshot_url );
|
||||
$theme->authorAndUri = wp_kses( $theme->author['display_name'], $themes_allowedtags );
|
||||
$theme->compatibleWP = is_wp_version_compatible( $theme->requires );
|
||||
$theme->compatiblePHP = is_php_version_compatible( $theme->requires_php );
|
||||
|
||||
if ( isset( $theme->parent ) ) {
|
||||
$theme->parent = $theme->parent['slug'];
|
||||
|
||||
@@ -133,7 +133,11 @@ class WP_Customize_Theme_Control extends WP_Customize_Control {
|
||||
<div class="theme-id-container">
|
||||
<h3 class="theme-name" id="{{ data.section }}-{{ data.theme.id }}-name">{{ data.theme.name }}</h3>
|
||||
<div class="theme-actions">
|
||||
<button type="button" class="button button-primary theme-install preview" aria-label="<?php echo esc_attr( $install_label ); ?>" data-slug="{{ data.theme.id }}" data-name="{{ data.theme.name }}"><?php _e( 'Install & Preview' ); ?></button>
|
||||
<# if ( data.theme.compatibleWP && data.theme.compatiblePHP ) { #>
|
||||
<button type="button" class="button button-primary theme-install preview" aria-label="<?php echo esc_attr( $install_label ); ?>" data-slug="{{ data.theme.id }}" data-name="{{ data.theme.name }}"><?php _e( 'Install & Preview' ); ?></button>
|
||||
<# } else { #>
|
||||
<button type="button" class="button button-primary disabled" aria-label="<?php echo esc_attr( $install_label ); ?>" disabled><?php _e( 'Install & Preview' ); ?></button>
|
||||
<# } #>
|
||||
</div>
|
||||
</div>
|
||||
<# } #>
|
||||
|
||||
Reference in New Issue
Block a user