WordPress.org

Make WordPress Core

Changeset 16718


Ignore:
Timestamp:
12/04/2010 04:31:55 AM (11 years ago)
Author:
nacin
Message:

Always land on style.css by default, rather than whichever stylesheet came first in the directory scan. Prevents useless trips to editor-style-rtl.css and the like. see #15672.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/theme-editor.php

    r16715 r16718  
    4545    wp_die(__('The requested theme does not exist.'));
    4646
    47 $allowed_files = array_merge($themes[$theme]['Stylesheet Files'], $themes[$theme]['Template Files']);
    48 
    49 if (empty($file)) {
    50     $file = $allowed_files[0];
     47$allowed_files = array_merge( $themes[$theme]['Stylesheet Files'], $themes[$theme]['Template Files'] );
     48
     49if ( empty( $file ) ) {
     50    if ( false !== array_search( $themes[$theme]['Stylesheet Dir'] . '/style.css', $allowed_files ) )
     51        $file = $themes[$theme]['Stylesheet Dir'] . '/style.css';
     52    else
     53        $file = $allowed_files[0];
    5154} else {
    5255    $file = stripslashes($file);
Note: See TracChangeset for help on using the changeset viewer.