diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 2a01f700ac..363a320dd9 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -214,7 +214,8 @@ function wp_title($sep = '»', $display = true) { // If there is a post if ( is_single() || is_page() ) { - $title = strip_tags($wp_query->get_queried_object()->post_title); + $post = $wp_query->get_queried_object(); + $title = strip_tags($post->post_title); $title = apply_filters('single_post_title', $title); }