diff --git a/wp-includes/template.php b/wp-includes/template.php index 01f9c8a715..cc15eedb48 100644 --- a/wp-includes/template.php +++ b/wp-includes/template.php @@ -135,8 +135,9 @@ function get_post_type_archive_template() { $post_type = reset( $post_type ); $obj = get_post_type_object( $post_type ); - if ( ! $obj->has_archive ) + if ( ! ( $obj instanceof WP_Post_Type ) || ! $obj->has_archive ) { return ''; + } return get_archive_template(); } diff --git a/wp-includes/version.php b/wp-includes/version.php index b99db66045..770f018f15 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-40030'; +$wp_version = '4.8-alpha-40031'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.