Changeset 3250 for branches/plugin/bbp-includes/bbp-topic-template.php
- Timestamp:
- 05/28/2011 09:06:09 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-topic-template.php
r3243 r3250 461 461 462 462 return apply_filters( 'bbp_get_topic_title', get_the_title( $topic_id ), $topic_id ); 463 } 464 465 /** 466 * Output the topic archive title 467 * 468 * @since bbPress (r3249) 469 * 470 * @param string $title Default text to use as title 471 */ 472 function bbp_topic_archive_title( $title = '' ) { 473 echo bbp_get_topic_archive_title( $title ); 474 } 475 /** 476 * Return the topic archive title 477 * 478 * @since bbPress (r3249) 479 * 480 * @global bbPress $bbp The main bbPress class 481 * @param string $title Default text to use as title 482 * 483 * @uses get_page_by_path() Check if page exists at root path 484 * @uses get_the_title() Use the page title at the root path 485 * @uses get_post_type_object() Load the post type object 486 * @uses bbp_get_topic_post_type() Get the topic post type ID 487 * @uses get_post_type_labels() Get labels for topic post type 488 * @uses apply_filters() Allow output to be manipulated 489 * 490 * @return string The topic archive title 491 */ 492 function bbp_get_topic_archive_title( $title = '' ) { 493 global $bbp; 494 495 // If no title was passed 496 if ( empty( $title ) ) { 497 498 // Set root text to page title 499 if ( $page = get_page_by_path( $bbp->topic_archive_slug ) ) { 500 $title = get_the_title( $page->ID ); 501 502 // Default to topic post type name label 503 } else { 504 $tto = get_post_type_object( bbp_get_topic_post_type() ); 505 $title = $tto->labels->name; 506 } 507 } 508 509 return apply_filters( 'bbp_get_topic_archive_title', $title ); 463 510 } 464 511
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)