diff --git wp-admin/includes/class-wp-upgrader.php wp-admin/includes/class-wp-upgrader.php
index 4f45050..e803ae8 100644
|
|
class Theme_Upgrader extends WP_Upgrader { |
902 | 902 | } |
903 | 903 | |
904 | 904 | function check_package($source) { |
905 | | global $wp_filesystem; |
| 905 | global $wp_filesystem, $wp_version; |
906 | 906 | |
907 | 907 | if ( is_wp_error($source) ) |
908 | 908 | return $source; |
… |
… |
class Theme_Upgrader extends WP_Upgrader { |
916 | 916 | if ( ! file_exists( $working_directory . 'style.css' ) ) |
917 | 917 | return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], __('The theme is missing the <code>style.css</code> stylesheet.') ); |
918 | 918 | |
919 | | $info = get_file_data( $working_directory . 'style.css', array( 'Name' => 'Theme Name', 'Template' => 'Template' ) ); |
| 919 | $info = get_file_data( $working_directory . 'style.css', array( 'Name' => 'Theme Name', 'Template' => 'Template', 'Requires' => 'Requires at least', ) ); |
920 | 920 | |
921 | 921 | if ( empty( $info['Name'] ) ) |
922 | 922 | return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], __("The <code>style.css</code> stylesheet doesn't contain a valid theme header.") ); |
… |
… |
class Theme_Upgrader extends WP_Upgrader { |
925 | 925 | if ( empty( $info['Template'] ) && ! file_exists( $working_directory . 'index.php' ) ) |
926 | 926 | return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], __('The theme is missing the <code>index.php</code> file.') ); |
927 | 927 | |
| 928 | // Check WordPress version requirements |
| 929 | if ( version_compare( $wp_version, $info['Requires'], '<' ) ) |
| 930 | return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], sprintf( __('The theme requires WordPress %s or higher. Please <a href="%s">update WordPress</a>.'), $info['Requires'], network_admin_url('update-core.php') ) ); |
| 931 | |
928 | 932 | return $source; |
929 | 933 | } |
930 | 934 | |