From ad956b105c732b2804887f8a22f936c87e76fbdd Mon Sep 17 00:00:00 2001 From: joedolson Date: Fri, 31 Oct 2025 23:23:36 +0000 Subject: [PATCH] Themes: Prevent PHP notice thrown in `wp_title_parts`. The value passed to the `wp_title_parts` filter is run through `explode()`, but can be empty. This throws a PHP notice. If value of `$title` is empty, return an empty array without exploding. Props nexbridge, dhruvang21, tussendoor, michaelreetz, o-o, beee, sabernhardt, sirlouen, nimeshatxecurify, westonruter, sirlouen. Fixes #61352. Built from https://develop.svn.wordpress.org/trunk@61108 git-svn-id: http://core.svn.wordpress.org/trunk@60444 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/general-template.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 5f432c7a41..acc3d611a6 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -1436,7 +1436,7 @@ function wp_title( $sep = '»', $display = true, $seplocation = '' ) { * * @param string[] $title_array Array of parts of the page title. */ - $title_array = apply_filters( 'wp_title_parts', explode( $t_sep, $title ) ); + $title_array = apply_filters( 'wp_title_parts', ! empty( $title ) ? explode( $t_sep, $title ) : array() ); // Determines position of the separator and direction of the breadcrumb. if ( 'right' === $seplocation ) { // Separator on right, so reverse the order. diff --git a/wp-includes/version.php b/wp-includes/version.php index 03a9b096e4..ae6eec3724 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.9-beta2-61107'; +$wp_version = '6.9-beta2-61108'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.