mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 15:47:05 +00:00
Support single line Template Name comment blocks for theme Templates and apply same cleanup to all header lines. Fixes #8497 props DD32 and Denis-de-Bernardy.
git-svn-id: https://develop.svn.wordpress.org/trunk@11168 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -52,7 +52,7 @@ function get_file_description( $file ) {
|
||||
elseif ( file_exists( WP_CONTENT_DIR . $file ) && is_file( WP_CONTENT_DIR . $file ) ) {
|
||||
$template_data = implode( '', file( WP_CONTENT_DIR . $file ) );
|
||||
if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ))
|
||||
return $name[1] . ' Page Template';
|
||||
return _cleanup_header_comment($name[1]) . ' Page Template';
|
||||
}
|
||||
|
||||
return basename( $file );
|
||||
|
||||
Reference in New Issue
Block a user