Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-theme.php

    r21120 r21050  
    931931
    932932            foreach ( $files as $file => $full_path ) {
    933                 if ( ! preg_match( '|Template Name:(.*)$|mi', file_get_contents( $full_path ), $header ) )
     933                $headers = get_file_data( $full_path, array( 'Template Name' => 'Template Name' ) );
     934                if ( empty( $headers['Template Name'] ) )
    934935                    continue;
    935                 $page_templates[ $file ] = _cleanup_header_comment( $header[1] );
     936                $page_templates[ $file ] = $headers['Template Name'];
    936937            }
    937938
Note: See TracChangeset for help on using the changeset viewer.