Skip to:
Content

bbPress.org

Ticket #1764: template-tags.php.patch

File template-tags.php.patch, 3.6 KB (added by MZAWeb, 12 years ago)
  • includes/common/template-tags.php

     
    24662466 * @uses apply_filters() Calls 'bbp_raw_title' with the title
    24672467 * @uses apply_filters() Calls 'bbp_profile_page_wp_title' with the title,
    24682468 *                        separator and separator location
     2469 * @uses apply_filters() Calls 'bbp_pre_title_single_forum' with the static
     2470 *                                                text before the single forum title
     2471 * @uses apply_filters() Calls 'bbp_pre_title_single_topic' with the static
     2472 *                                                text before the single topic title
     2473 * @uses apply_filters() Calls 'bbp_pre_title_single_reply' with the static
     2474 *                                                text before the single reply title
     2475 * @uses apply_filters() Calls 'bbp_pre_title_topic_tag' with the static
     2476 *                                                text before the single topic tag title
     2477 * @uses apply_filters() Calls 'bbp_pre_title_single_view' with the static
     2478 *                                                text before the single view title
     2479 * @uses apply_filters() Calls 'bbp_pre_title_search' with the static
     2480 *                                                text before the search results title
     2481 *
    24692482 * @return string The tite
    24702483 */
    24712484function bbp_title( $title = '', $sep = '»', $seplocation = '' ) {
     
    24872500
    24882501        // Forum page
    24892502        } elseif ( bbp_is_single_forum() ) {
    2490                 $title = sprintf( __( 'Forum: %s', 'bbpress' ), bbp_get_forum_title() );
     2503                $pre_title = apply_filters( 'bbp_pre_title_single_forum', __( 'Forum:', 'bbpress' ) );
    24912504
     2505                if ( ! empty( $pre_title ) )
     2506                        $pre_title = $pre_title . ' ';
     2507
     2508                $title = sprintf( '%s%s', $pre_title, bbp_get_forum_title() );
     2509
    24922510        // Topic page
    24932511        } elseif ( bbp_is_single_topic() ) {
    2494                 $title = sprintf( __( 'Topic: %s', 'bbpress' ), bbp_get_topic_title() );
    24952512
     2513                $pre_title = apply_filters( 'bbp_pre_title_single_topic', __( 'Topic:', 'bbpress' ) );
     2514
     2515                if ( ! empty( $pre_title ) )
     2516                        $pre_title = $pre_title . ' ';
     2517
     2518                $title = sprintf( '%s%s', $pre_title, bbp_get_topic_title() );
     2519
    24962520        // Replies
    24972521        } elseif ( bbp_is_single_reply() ) {
    2498                 $title = bbp_get_reply_title();
    24992522
     2523                $pre_title = apply_filters( 'bbp_pre_title_single_reply', '' );
     2524
     2525                if ( ! empty( $pre_title ) )
     2526                        $pre_title = $pre_title . ' ';
     2527
     2528                $title = sprintf( '%s%s', $pre_title, bbp_get_reply_title() );
     2529
    25002530        // Topic tag page (or edit)
    25012531        } elseif ( bbp_is_topic_tag() || bbp_is_topic_tag_edit() || get_query_var( 'bbp_topic_tag' ) ) {
    25022532                $term  = get_queried_object();
    2503                 $title = sprintf( __( 'Topic Tag: %s', 'bbpress' ), $term->name );
    25042533
     2534                $pre_title = apply_filters( 'bbp_pre_title_topic_tag', __( 'Topic Tag:', 'bbpress' ) );
     2535
     2536                if ( ! empty( $pre_title ) )
     2537                        $pre_title = $pre_title . ' ';
     2538
     2539                $title = sprintf( '%s%s', $pre_title, $term->name );
     2540
    25052541        /** Users *****************************************************************/
    25062542
    25072543        // Profile page
     
    25342570
    25352571        // Views
    25362572        } elseif ( bbp_is_single_view() ) {
    2537                 $title = sprintf( __( 'View: %s', 'bbpress' ), bbp_get_view_title() );
    25382573
     2574                $pre_title = apply_filters( 'bbp_pre_title_single_view', __( 'View:', 'bbpress' ) );
     2575
     2576                if ( ! empty( $pre_title ) )
     2577                        $pre_title = $pre_title . ' ';
     2578
     2579                $title = sprintf( '%s%s', $pre_title, bbp_get_view_title() );
     2580
     2581
    25392582        /** Search ****************************************************************/
    25402583
    25412584        // Search
    25422585        } elseif ( bbp_is_search() ) {
    2543                 $title = bbp_get_search_title();
     2586
     2587                $pre_title = apply_filters( 'bbp_pre_title_search', '' );
     2588
     2589                if ( ! empty( $pre_title ) )
     2590                        $pre_title = $pre_title . ' ';
     2591
     2592                $title = sprintf( '%s%s', $pre_title, bbp_get_search_title() );
     2593
    25442594        }
    25452595
    25462596        // Filter the raw title