WordPress.org

Make WordPress Core

Ticket #17877: 17877.3.diff

File 17877.3.diff, 941 bytes (added by obenland, 6 years ago)

Added filter documentation

  • src/wp-includes/general-template.php

     
    836836        if ( !empty($title) )
    837837                $prefix = " $sep ";
    838838
     839        /**
     840         * Filter the parts of the document title.
     841         *
     842         * @since 4.0.0
     843         *
     844         * @param array $title_array Parts of the document 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        }
    848855