Changeset 20317 for trunk/wp-includes/class-wp-theme.php
- Timestamp:
- 03/29/2012 05:37:37 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-theme.php
r20316 r20317 998 998 $page_templates = array(); 999 999 1000 $files = (array) self::scandir( $this->get_template_directory(), 'php' ); 1001 if ( $this->is_child_theme() ) 1002 $files = array_merge_recursive( $files, (array) self::scandir( $this->get_stylesheet_directory(), 'php' ) ); 1003 1004 foreach ( $files['php'] as $file ) { 1005 $headers = get_file_data( $file, array( 'Template Name' => 'Template Name' ) ); 1000 $files = (array) self::scandir( $this->get_stylesheet_directory(), 'php' ); 1001 1002 foreach ( $files['php'] as $file => $full_path ) { 1003 $headers = get_file_data( $full_path, array( 'Template Name' => 'Template Name' ) ); 1006 1004 if ( empty( $headers['Template Name'] ) ) 1007 1005 continue; 1008 $page_templates[ basename( $file )] = $this->translate_header( 'Template Name', $headers['Template Name'] );1006 $page_templates[ $file ] = $this->translate_header( 'Template Name', $headers['Template Name'] ); 1009 1007 } 1010 1008 1011 1009 $this->cache_add( 'page_templates', $page_templates ); 1010 1011 if ( $this->parent() ) 1012 $page_templates += $this->parent()->get_page_templates(); 1013 1012 1014 return $page_templates; 1013 1015 }
Note: See TracChangeset
for help on using the changeset viewer.