WordPress.org

Make WordPress Core

Ticket #38374: 38374.diff

File 38374.diff, 460 bytes (added by dlh, 5 years ago)
  • src/wp-includes/template.php

     
    135135                $post_type = reset( $post_type );
    136136
    137137        $obj = get_post_type_object( $post_type );
    138         if ( ! $obj->has_archive )
     138        if ( ! ( $obj instanceof WP_Post_Type ) || ! $obj->has_archive ) {
    139139                return '';
     140        }
    140141
    141142        return get_archive_template();
    142143}