Changeset 11035
- Timestamp:
- 06/17/2021 05:55:59 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php
r11034 r11035 741 741 public function check_theme( $files ) { 742 742 // Load the theme checking code. 743 if ( ! function_exists( 'run_themechecks ' ) ) {743 if ( ! function_exists( 'run_themechecks_against_theme' ) ) { 744 744 include_once WP_PLUGIN_DIR . '/theme-check/checkbase.php'; 745 745 } 746 746 747 list( $php_files, $css_files, $other_files ) = $this->separate_files( $files );748 749 747 // Run the checks. 750 $result = run_themechecks ( $php_files, $css_files, $other_files);748 $result = run_themechecks_against_theme( $this->theme, $this->theme_slug ); 751 749 752 750 // Display the errors. … … 1266 1264 1267 1265 return $files; 1268 }1269 1270 /**1271 * Separates files in three buckets, PHP files, CSS files, and others.1272 *1273 * Most likely used in preparation for the Theme Check plugin.1274 *1275 * @param array $files Files to separate.1276 * @return array1277 */1278 public function separate_files( $files ) {1279 $php_files = $css_files = $other_files = array();1280 1281 foreach ( $files as $file ) {1282 // PHP files.1283 if ( true === fnmatch( "*.php", $file ) ) {1284 $php_files[ $file ] = php_strip_whitespace( $file );1285 1286 // CSS files.1287 } else if ( true === fnmatch( "*.css", $file ) ) {1288 $css_files[ $file ] = file_get_contents( $file );1289 1290 // All the rest.1291 } else {1292 $other_files[ $file ] = file_get_contents( $file );1293 }1294 }1295 1296 return array( $php_files, $css_files, $other_files );1297 1266 } 1298 1267
Note: See TracChangeset
for help on using the changeset viewer.