Changeset 5018
- Timestamp:
- 07/10/2013 07:28:21 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/common/template-tags.php
r5010 r5018 2509 2509 $_title = $title; 2510 2510 2511 // Title array 2512 $title = array(); 2513 2511 2514 /** Archives **************************************************************/ 2512 2515 2513 2516 // Forum Archive 2514 2517 if ( bbp_is_forum_archive() ) { 2515 $title = bbp_get_forum_archive_title();2518 $title['text'] = bbp_get_forum_archive_title(); 2516 2519 2517 2520 // Topic Archive 2518 2521 } elseif ( bbp_is_topic_archive() ) { 2519 $title = bbp_get_topic_archive_title(); 2522 $title['text'] = bbp_get_topic_archive_title(); 2523 2524 /** Edit ******************************************************************/ 2525 2526 // Forum edit page 2527 } elseif ( bbp_is_forum_edit() ) { 2528 $title['text'] = bbp_get_forum_title(); 2529 $title['format'] = esc_attr__( 'Forum Edit: %s', 'bbpress' ); 2530 2531 // Topic edit page 2532 } elseif ( bbp_is_topic_edit() ) { 2533 $title['text'] = bbp_get_topic_title(); 2534 $title['format'] = esc_attr__( 'Topic Edit: %s', 'bbpress' ); 2535 2536 // Reply edit page 2537 } elseif ( bbp_is_reply_edit() ) { 2538 $title['text'] = bbp_get_reply_title(); 2539 $title['format'] = esc_attr__( 'Reply Edit: %s', 'bbpress' ); 2540 2541 // Topic tag edit page 2542 } elseif ( bbp_is_topic_tag_edit() ) { 2543 $title['text'] = bbp_get_topic_tag_name(); 2544 $title['format'] = esc_attr__( 'Topic Tag Edit: %s', 'bbpress' ); 2520 2545 2521 2546 /** Singles ***************************************************************/ … … 2523 2548 // Forum page 2524 2549 } elseif ( bbp_is_single_forum() ) { 2525 $title = sprintf( __( 'Forum: %s', 'bbpress' ), bbp_get_forum_title() ); 2550 $title['text'] = bbp_get_forum_title(); 2551 $title['format'] = esc_attr__( 'Forum: %s', 'bbpress' ); 2526 2552 2527 2553 // Topic page 2528 2554 } elseif ( bbp_is_single_topic() ) { 2529 $title = sprintf( __( 'Topic: %s', 'bbpress' ), bbp_get_topic_title() ); 2555 $title['text'] = bbp_get_topic_title(); 2556 $title['format'] = esc_attr__( 'Topic: %s', 'bbpress' ); 2530 2557 2531 2558 // Replies 2532 2559 } elseif ( bbp_is_single_reply() ) { 2533 $title = bbp_get_reply_title();2534 2535 // Topic tag page (or edit)2536 } elseif ( bbp_is_topic_tag() || bbp_is_topic_tag_edit() ||get_query_var( 'bbp_topic_tag' ) ) {2537 $t erm = get_queried_object();2538 $title = sprintf( __( 'Topic Tag: %s', 'bbpress' ), $term->name);2560 $title['text'] = bbp_get_reply_title(); 2561 2562 // Topic tag page 2563 } elseif ( bbp_is_topic_tag() || get_query_var( 'bbp_topic_tag' ) ) { 2564 $title['text'] = bbp_get_topic_tag_name(); 2565 $title['format'] = esc_attr__( 'Topic Tag: %s', 'bbpress' ); 2539 2566 2540 2567 /** Users *****************************************************************/ … … 2545 2572 // Current users profile 2546 2573 if ( bbp_is_user_home() ) { 2547 $title =__( 'Your Profile', 'bbpress' );2574 $title['text'] = esc_attr__( 'Your Profile', 'bbpress' ); 2548 2575 2549 2576 // Other users profile 2550 2577 } else { 2551 $ userdata = get_userdata( bbp_get_user_id() );2552 $title = sprintf( __( '%s\'s Profile', 'bbpress' ), $userdata->display_name);2578 $title['text'] = get_userdata( bbp_get_user_id() )->display_name; 2579 $title['format'] = esc_attr__( "%s's Profile", 'bbpress' ); 2553 2580 } 2554 2581 … … 2558 2585 // Current users profile 2559 2586 if ( bbp_is_user_home_edit() ) { 2560 $title =__( 'Edit Your Profile', 'bbpress' );2587 $title['text'] = esc_attr__( 'Edit Your Profile', 'bbpress' ); 2561 2588 2562 2589 // Other users profile 2563 2590 } else { 2564 $ userdata = get_userdata( bbp_get_user_id() );2565 $title = sprintf( __( 'Edit %s\'s Profile', 'bbpress' ), $userdata->display_name);2591 $title['text'] = get_userdata( bbp_get_user_id() )->display_name; 2592 $title['format'] = esc_attr__( "Edit %s's Profile", 'bbpress' ); 2566 2593 } 2567 2594 … … 2570 2597 // Views 2571 2598 } elseif ( bbp_is_single_view() ) { 2572 $title = sprintf( __( 'View: %s', 'bbpress' ), bbp_get_view_title() ); 2599 $title['text'] = bbp_get_view_title(); 2600 $title['format'] = esc_attr__( 'View: %s', 'bbpress' ); 2573 2601 2574 2602 /** Search ****************************************************************/ … … 2576 2604 // Search 2577 2605 } elseif ( bbp_is_search() ) { 2578 $title = bbp_get_search_title();2606 $title['text'] = bbp_get_search_title(); 2579 2607 } 2608 2609 // This filter is deprecated. Use 'bbp_before_title_parse_args' instead. 2610 $title = apply_filters( 'bbp_raw_title_array', $title ); 2611 2612 // Set title array defaults 2613 $title = bbp_parse_args( $title, array( 2614 'text' => '', 2615 'format' => '%s' 2616 ), 'title' ); 2617 2618 // Get the formatted raw title 2619 $title = sprintf( $title['format'], $title['text'] ); 2580 2620 2581 2621 // Filter the raw title
Note: See TracChangeset
for help on using the changeset viewer.