Changeset 15819 for trunk/wp-includes/general-template.php
- Timestamp:
- 10/15/2010 07:44:57 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/general-template.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/general-template.php
r15771 r15819 548 548 } 549 549 550 // If there's a post type archive 551 if ( is_post_type_archive() ) 552 $title = post_type_archive_title( '', false ); 553 550 554 // If there's a month 551 555 if ( is_archive() && !empty($m) ) { … … 612 616 * 613 617 * @since 0.71 614 * @uses $wpdb615 618 * 616 619 * @param string $prefix Optional. What to display before the title. … … 636 639 } 637 640 641 /** 642 * Display or retrieve title for a post type archive. 643 * 644 * This is optimized for archive.php and archive-{$post_type}.php template files 645 * for displaying the title of the post type. 646 * 647 * @since 3.1.0 648 * 649 * @param string $prefix Optional. What to display before the title. 650 * @param bool $display Optional, default is true. Whether to display or retrieve title. 651 * @return string|null Title when retrieving, null when displaying or failure. 652 */ 653 function post_type_archive_title() { 654 if ( ! is_post_type_archive() ) 655 return; 656 657 658 $post_type_obj = get_post_type_object( get_query_var( 'post_type' ) ); 659 $title = apply_filters('post_type_archive_title', $post_type_obj->labels->name ); 660 661 if ( $display ) 662 echo $prefix . $title; 663 else 664 return $title; 665 } 666 638 667 /** 639 668 * Display or retrieve page title for category archive.
Note: See TracChangeset
for help on using the changeset viewer.