From f54a73f637ffa36aae26e2fb451a80a4a3004fa2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 5 Jun 2014 00:27:37 +0000 Subject: [PATCH] Add 'wp_title_parts' filter to wp_title(). props aaroncampbell, obenland. fixes #17877. git-svn-id: https://develop.svn.wordpress.org/trunk@28669 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/general-template.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 922ab8fb84..1b08219206 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -836,13 +836,20 @@ function wp_title($sep = '»', $display = true, $seplocation = '') { if ( !empty($title) ) $prefix = " $sep "; + /** + * Filter the parts of the page title. + * + * @since 4.0.0 + * + * @param array $title_array Parts of the page title. + */ + $title_array = apply_filters( 'wp_title_parts', explode( $t_sep, $title ) ); + // Determines position of the separator and direction of the breadcrumb if ( 'right' == $seplocation ) { // sep on right, so reverse the order - $title_array = explode( $t_sep, $title ); $title_array = array_reverse( $title_array ); $title = implode( " $sep ", $title_array ) . $prefix; } else { - $title_array = explode( $t_sep, $title ); $title = $prefix . implode( " $sep ", $title_array ); }