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: http://svn.automattic.com/wordpress/trunk@16718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5021403b9d
commit
88d961937e
|
@ -44,10 +44,13 @@ if (empty($theme)) {
|
||||||
if ( ! isset($themes[$theme]) )
|
if ( ! isset($themes[$theme]) )
|
||||||
wp_die(__('The requested theme does not exist.'));
|
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 ) ) {
|
||||||
$file = $allowed_files[0];
|
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 {
|
} else {
|
||||||
$file = stripslashes($file);
|
$file = stripslashes($file);
|
||||||
if ( 'theme' == $dir ) {
|
if ( 'theme' == $dir ) {
|
||||||
|
|
Loading…
Reference in New Issue