WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/29/2012 08:18:53 PM (9 years ago)
Author:
nacin
Message:

Translate page template names! Have WP_Theme::get_page_templates() return templates keyed by filename, not by template name, as it makes more sense. Flip this in get_page_templates() to be compatible. fixes #6007.

File:
1 edited

Legend:

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

    r20039 r20041  
    922922
    923923        foreach ( $files['php'] as $file ) {
    924             $headers = get_file_data( $file, array( 'Name' => 'Template Name' ) );
    925             if ( empty( $headers['Name'] ) )
     924            $headers = get_file_data( $file, array( 'Template Name' => 'Template Name' ) );
     925            if ( empty( $headers['Template Name'] ) )
    926926                continue;
    927             $page_templates[ $headers['Name'] ] = basename( $file );
     927            $page_templates[ basename( $file ) ] = $this->translate_header( 'Template Name', $headers['Template Name'] );
    928928        }
    929929
Note: See TracChangeset for help on using the changeset viewer.