Ensure we're matching the complete theme directory when excluding parent templates from the theme editor. props chrisbliss18, fixes #16607 for trunk.
git-svn-id: http://svn.automattic.com/wordpress/trunk@17471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b4173bbc4e
commit
30bf87b24d
|
@ -180,7 +180,7 @@ if ($allowed_files) :
|
||||||
$template_dir = $themes[$theme]['Template Dir'];
|
$template_dir = $themes[$theme]['Template Dir'];
|
||||||
foreach ( $themes[$theme]['Template Files'] as $template_file ) {
|
foreach ( $themes[$theme]['Template Files'] as $template_file ) {
|
||||||
// Don't show parent templates.
|
// Don't show parent templates.
|
||||||
if ( $is_child_theme && strpos( $template_file, $themes[$theme]['Template Dir'] ) === 0 )
|
if ( $is_child_theme && strpos( $template_file, trailingslashit( $template_dir ) ) === 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$description = trim( get_file_description($template_file) );
|
$description = trim( get_file_description($template_file) );
|
||||||
|
@ -202,7 +202,7 @@ if ($allowed_files) :
|
||||||
$stylesheet_dir = $themes[$theme]['Stylesheet Dir'];
|
$stylesheet_dir = $themes[$theme]['Stylesheet Dir'];
|
||||||
foreach ( $themes[$theme]['Stylesheet Files'] as $style_file ) {
|
foreach ( $themes[$theme]['Stylesheet Files'] as $style_file ) {
|
||||||
// Don't show parent styles.
|
// Don't show parent styles.
|
||||||
if ( $is_child_theme && strpos( $style_file, $themes[$theme]['Template Dir'] ) === 0 )
|
if ( $is_child_theme && strpos( $style_file, trailingslashit( $template_dir ) ) === 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$description = trim( get_file_description($style_file) );
|
$description = trim( get_file_description($style_file) );
|
||||||
|
|
Loading…
Reference in New Issue