From 27b99164da889f332dc5cf075996326a512a1f65 Mon Sep 17 00:00:00 2001 From: Paul Kevan <2290623+pkevan@users.noreply.github.com> Date: Wed, 21 Aug 2024 15:29:59 +0100 Subject: [PATCH] Update head.php (#538) Adds addition check around query_var lookup. --- source/wp-content/themes/wporg-developer-2023/inc/head.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/wp-content/themes/wporg-developer-2023/inc/head.php b/source/wp-content/themes/wporg-developer-2023/inc/head.php index 5cf1cc47..9f6d6a07 100644 --- a/source/wp-content/themes/wporg-developer-2023/inc/head.php +++ b/source/wp-content/themes/wporg-developer-2023/inc/head.php @@ -48,7 +48,7 @@ public static function document_title( $parts ) { if ( get_post_type_object( $post_type ) ) { $parts['title'] .= " $sep " . get_post_type_object( $post_type )->labels->singular_name; } - } elseif ( ( is_singular() || is_post_type_archive() ) && false !== strpos( $post_type, 'handbook' ) ) { + } elseif ( ( is_singular() || is_post_type_archive() ) && is_string( $post_type ) && false !== strpos( $post_type, 'handbook' ) ) { // Add handbook name to title if relevant. if ( get_post_type_object( $post_type ) ) { $handbook_label = get_post_type_object( $post_type )->labels->name;