WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/23/2017 08:07:06 PM (4 years ago)
Author:
swissspidy
Message:

Themes: Show templates from both parent and child theme when calling WP_Theme::get_post_templates().

Props birgire for initial patch.
Fixes #41717.

File:
1 edited

Legend:

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

    r41806 r41975  
    10371037            $post_templates = array();
    10381038
    1039             $files = (array) $this->get_files( 'php', 1 );
     1039            $files = (array) $this->get_files( 'php', 1, true);
    10401040
    10411041            foreach ( $files as $file => $full_path ) {
     
    10911091        $post_templates = $this->get_post_templates();
    10921092        $post_templates = isset( $post_templates[ $post_type ] ) ? $post_templates[ $post_type ] : array();
    1093 
    1094         if ( $this->parent() ) {
    1095             $post_templates += $this->parent()->get_page_templates( $post, $post_type );
    1096         }
    10971093
    10981094        /**
Note: See TracChangeset for help on using the changeset viewer.