mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Lots of fixes for Notices when WP_DEBUG is set. See #6669 props santosj.
git-svn-id: https://develop.svn.wordpress.org/trunk@8589 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -35,11 +35,13 @@ function get_page_templates() {
|
||||
foreach ( $templates as $template ) {
|
||||
$template_data = implode( '', file( WP_CONTENT_DIR.$template ));
|
||||
|
||||
preg_match( '|Template Name:(.*)$|mi', $template_data, $name );
|
||||
preg_match( '|Description:(.*)$|mi', $template_data, $description );
|
||||
$name = '';
|
||||
if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ) )
|
||||
$name = $name[1];
|
||||
|
||||
$name = $name[1];
|
||||
$description = $description[1];
|
||||
$description = '';
|
||||
if( preg_match( '|Description:(.*)$|mi', $template_data, $description ) )
|
||||
$description = $description[1];
|
||||
|
||||
if ( !empty( $name ) ) {
|
||||
$page_templates[trim( $name )] = basename( $template );
|
||||
|
||||
Reference in New Issue
Block a user