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.
git-svn-id: https://develop.svn.wordpress.org/trunk@16718 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7cf388085a
commit
6587afe1d1
@ -44,9 +44,12 @@ if (empty($theme)) {
|
||||
if ( ! isset($themes[$theme]) )
|
||||
wp_die(__('The requested theme does not exist.'));
|
||||
|
||||
$allowed_files = array_merge($themes[$theme]['Stylesheet Files'], $themes[$theme]['Template Files']);
|
||||
$allowed_files = array_merge( $themes[$theme]['Stylesheet Files'], $themes[$theme]['Template Files'] );
|
||||
|
||||
if (empty($file)) {
|
||||
if ( empty( $file ) ) {
|
||||
if ( false !== array_search( $themes[$theme]['Stylesheet Dir'] . '/style.css', $allowed_files ) )
|
||||
$file = $themes[$theme]['Stylesheet Dir'] . '/style.css';
|
||||
else
|
||||
$file = $allowed_files[0];
|
||||
} else {
|
||||
$file = stripslashes($file);
|
||||
|
Loading…
Reference in New Issue
Block a user