Ticket #1764: template-tags.php.patch
File template-tags.php.patch, 3.6 KB (added by , 12 years ago) |
---|
-
includes/common/template-tags.php
2466 2466 * @uses apply_filters() Calls 'bbp_raw_title' with the title 2467 2467 * @uses apply_filters() Calls 'bbp_profile_page_wp_title' with the title, 2468 2468 * 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 * 2469 2482 * @return string The tite 2470 2483 */ 2471 2484 function bbp_title( $title = '', $sep = '»', $seplocation = '' ) { … … 2487 2500 2488 2501 // Forum page 2489 2502 } 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' ) ); 2491 2504 2505 if ( ! empty( $pre_title ) ) 2506 $pre_title = $pre_title . ' '; 2507 2508 $title = sprintf( '%s%s', $pre_title, bbp_get_forum_title() ); 2509 2492 2510 // Topic page 2493 2511 } elseif ( bbp_is_single_topic() ) { 2494 $title = sprintf( __( 'Topic: %s', 'bbpress' ), bbp_get_topic_title() );2495 2512 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 2496 2520 // Replies 2497 2521 } elseif ( bbp_is_single_reply() ) { 2498 $title = bbp_get_reply_title();2499 2522 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 2500 2530 // Topic tag page (or edit) 2501 2531 } elseif ( bbp_is_topic_tag() || bbp_is_topic_tag_edit() || get_query_var( 'bbp_topic_tag' ) ) { 2502 2532 $term = get_queried_object(); 2503 $title = sprintf( __( 'Topic Tag: %s', 'bbpress' ), $term->name );2504 2533 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 2505 2541 /** Users *****************************************************************/ 2506 2542 2507 2543 // Profile page … … 2534 2570 2535 2571 // Views 2536 2572 } elseif ( bbp_is_single_view() ) { 2537 $title = sprintf( __( 'View: %s', 'bbpress' ), bbp_get_view_title() );2538 2573 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 2539 2582 /** Search ****************************************************************/ 2540 2583 2541 2584 // Search 2542 2585 } 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 2544 2594 } 2545 2595 2546 2596 // Filter the raw title