Make WordPress Core


Ignore:
Timestamp:
05/18/2020 04:01:38 PM (3 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-admin/includes/theme.php

    r47818 r47819  
    828828                    <# } #>
    829829                <# } else { #>
    830                     <button type="button" class="button theme-install" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></button>
    831                     <button type="button" class="button button-primary theme-install preview" data-slug="{{ data.id }}"><?php _e( 'Install &amp; Preview' ); ?></button>
     830                    <# if ( data.compatibleWP && data.compatiblePHP ) { #>
     831                        <button type="button" class="button theme-install" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></button>
     832                        <button type="button" class="button button-primary theme-install preview" data-slug="{{ data.id }}"><?php _e( 'Install &amp; Preview' ); ?></button>
     833                    <# } else { #>
     834                        <button type="button" class="button disabled"><?php _ex( 'Cannot Install', 'theme' ); ?></button>
     835                        <button type="button" class="button button-primary disabled"><?php _e( 'Install &amp; Preview' ); ?></button>
     836                    <# } #>
    832837                <# } #>
    833838            </div>
Note: See TracChangeset for help on using the changeset viewer.