Changeset 51092
- Timestamp:
- 06/08/2021 10:11:49 AM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/plugin.php
r51064 r51092 1120 1120 * defined in the plugin's main PHP file. 1121 1121 * 1122 * If the headers are not present in the plugin's main PHP file,1123 * `readme.txt` is also checked as a fallback.1124 *1125 1122 * @since 5.2.0 1126 1123 * @since 5.3.0 Added support for reading the headers from the plugin's 1127 1124 * main PHP file, with `readme.txt` as a fallback. 1125 * @since 5.8.0 Removed support for using `readme.txt` as a fallback. 1128 1126 * 1129 1127 * @param string $plugin Path to the plugin file relative to the plugins directory. … … 1137 1135 'requires_php' => ! empty( $plugin_headers['RequiresPHP'] ) ? $plugin_headers['RequiresPHP'] : '', 1138 1136 ); 1139 1140 $readme_file = WP_PLUGIN_DIR . '/' . dirname( $plugin ) . '/readme.txt';1141 1142 if ( file_exists( $readme_file ) ) {1143 $readme_headers = get_file_data(1144 $readme_file,1145 array(1146 'requires' => 'Requires at least',1147 'requires_php' => 'Requires PHP',1148 ),1149 'plugin'1150 );1151 1152 $requirements = array_merge( $readme_headers, $requirements );1153 }1154 1137 1155 1138 $compatible_wp = is_wp_version_compatible( $requirements['requires'] ); -
trunk/src/wp-includes/theme.php
r50395 r51092 900 900 * defined in the theme's `style.css` file. 901 901 * 902 * If the headers are not present in the theme's stylesheet file,903 * `readme.txt` is also checked as a fallback.904 *905 902 * @since 5.5.0 903 * @since 5.8.0 Removed support for using `readme.txt` as a fallback. 906 904 * 907 905 * @param string $stylesheet Directory name for the theme. … … 915 913 'requires_php' => ! empty( $theme->get( 'RequiresPHP' ) ) ? $theme->get( 'RequiresPHP' ) : '', 916 914 ); 917 918 $readme_file = $theme->theme_root . '/' . $stylesheet . '/readme.txt';919 920 if ( file_exists( $readme_file ) ) {921 $readme_headers = get_file_data(922 $readme_file,923 array(924 'requires' => 'Requires at least',925 'requires_php' => 'Requires PHP',926 ),927 'theme'928 );929 930 $requirements = array_merge( $readme_headers, $requirements );931 }932 915 933 916 $compatible_wp = is_wp_version_compatible( $requirements['requires'] );
Note: See TracChangeset
for help on using the changeset viewer.