Make WordPress Core

Changeset 28669


Ignore:
Timestamp:
06/05/2014 12:27:37 AM (11 years ago)
Author:
SergeyBiryukov
Message:

Add 'wp_title_parts' filter to wp_title().

props aaroncampbell, obenland.
fixes #17877.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/general-template.php

    r28560 r28669  
    837837        $prefix = " $sep ";
    838838
     839    /**
     840     * Filter the parts of the page title.
     841     *
     842     * @since 4.0.0
     843     *
     844     * @param array $title_array Parts of the page title.
     845     */
     846    $title_array = apply_filters( 'wp_title_parts', explode( $t_sep, $title ) );
     847
    839848    // Determines position of the separator and direction of the breadcrumb
    840849    if ( 'right' == $seplocation ) { // sep on right, so reverse the order
    841         $title_array = explode( $t_sep, $title );
    842850        $title_array = array_reverse( $title_array );
    843851        $title = implode( " $sep ", $title_array ) . $prefix;
    844852    } else {
    845         $title_array = explode( $t_sep, $title );
    846853        $title = $prefix . implode( " $sep ", $title_array );
    847854    }
Note: See TracChangeset for help on using the changeset viewer.