Make WordPress Core


Ignore:
Timestamp:
05/18/2020 04:01:38 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Themes: Prevent installation of themes that require a higher version of PHP or WordPress.

Props afragen.
Fixes #49653. See #48491.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/customize/class-wp-customize-theme-control.php

    r47816 r47819  
    134134                    <h3 class="theme-name" id="{{ data.section }}-{{ data.theme.id }}-name">{{ data.theme.name }}</h3>
    135135                    <div class="theme-actions">
    136                         <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 &amp; Preview' ); ?></button>
     136                        <# if ( data.theme.compatibleWP && data.theme.compatiblePHP ) { #>
     137                            <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 &amp; Preview' ); ?></button>
     138                        <# } else { #>
     139                            <button type="button" class="button button-primary disabled" aria-label="<?php echo esc_attr( $install_label ); ?>" disabled><?php _e( 'Install &amp; Preview' ); ?></button>
     140                        <# } #>
    137141                    </div>
    138142                </div>
Note: See TracChangeset for help on using the changeset viewer.