Make WordPress Core

Ticket #21755: 21755.diff

File 21755.diff, 704 bytes (added by nacin, 12 years ago)
  • wp-includes/post.php

     
    27762776
    27772777        if ( !empty($page_template) && 'page' == $data['post_type'] ) {
    27782778                $post->page_template = $page_template;
    2779                 $page_templates = get_page_templates();
    2780                 if ( 'default' != $page_template && !in_array($page_template, $page_templates) ) {
     2779                $page_templates = wp_get_theme()->get_page_templates();
     2780                if ( 'default' != $page_template && ! isset( $page_templates[ $page_template ] ) ) {
    27812781                        if ( $wp_error )
    27822782                                return new WP_Error('invalid_page_template', __('The page template is invalid.'));
    27832783                        else