Skip to content

Commit da236b1

Browse files
authored
Assign $title_array variable before filter for better readabilty
1 parent 3ea38b0 commit da236b1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/wp-includes/general-template.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,9 +1428,11 @@ function wp_title( $sep = '»', $display = true, $seplocation = '' ) {
14281428
$title = '';
14291429
}
14301430

1431-
$prefix = '';
1431+
$prefix = '';
1432+
$title_array = array();
14321433
if ( '' !== $title ) {
1433-
$prefix = " $sep ";
1434+
$prefix = " $sep ";
1435+
$title_array = explode( $t_sep, $title );
14341436
}
14351437

14361438
/**
@@ -1440,7 +1442,7 @@ function wp_title( $sep = '»', $display = true, $seplocation = '' ) {
14401442
*
14411443
* @param string[] $title_array Array of parts of the page title.
14421444
*/
1443-
$title_array = apply_filters( 'wp_title_parts', explode( $t_sep, $title ) );
1445+
$title_array = apply_filters( 'wp_title_parts', $title_array );
14441446

14451447
// Determines position of the separator and direction of the breadcrumb.
14461448
if ( 'right' === $seplocation ) { // Separator on right, so reverse the order.

0 commit comments

Comments
 (0)