Changes between Initial Version and Version 1 of Ticket #20718
- Timestamp:
- 05/21/2012 10:15:47 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #20718 – Description
initial v1 1 1 When there's a custom page template named "something.php" defined with 2 2 {{{ 3 3 /* 4 4 Template Name: Something 5 5 */ 6 6 }}} 7 7 On the theme editor, the file list supposed to returns: 8 8 {{{ 9 9 "Something" 10 10 (something.php) 11 11 }}} 12 12 where it is displaying only the file name: 13 13 {{{ 14 14 "something.php" 15 15 }}} 16 16 Well it doesn't affect the functionality but it IS annoying. 17 17 … … 22 22 23 23 where: 24 24 {{{ 25 25 elseif ( file_exists( $file ) && is_file( $file ) ) { 26 26 $template_data = implode( '', file( $file ) ); 27 27 if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name )) 28 28 return sprintf( __( '%s Page Template' ), _cleanup_header_comment($name[1]) ); 29 29 }}} 30 30 Well, it will always returns the filename instead of the template name since it will never find the $file on the defined path. 31 31 32 32 It should be something like: 33 33 {{{ 34 34 elseif ( file_exists( get_template_directory() . '/' . $file ) && is_file( get_template_directory() . '/' . $file ) ) { 35 35 $template_data = implode( '', file( get_template_directory() . '/' . $file ) ); … … 37 37 return sprintf( __( '%s Page Template' ), _cleanup_header_comment($name[1]) ); 38 38 39 39 }}} 40 40 Again, it's nothing but annoying