Definition:
function post_type_archive_title( $prefix = '', $display = true ) {}
Display or retrieve title for a post type archive.
This is optimized for archive.php and archive-{$post_type}.php template files for displaying the title of the post type.
Parameters
- string $prefix: Optional. What to display before the title.
- bool $display: Optional, default is true. Whether to display or retrieve title.
Return values
returns:Title when retrieving, null when displaying or failure.
Defined filters
- post_type_archive_title
apply_filters('post_type_archive_title', $post_type_obj->labels->name )
Source code
function post_type_archive_title( $prefix = '', $display = true ) {
if ( ! is_post_type_archive() )
return;
$post_type_obj = get_queried_object();
$title = apply_filters('post_type_archive_title', $post_type_obj->labels->name );
if ( $display )
echo $prefix . $title;
else
return $title;
}
10128

February 24, 2011 


No comments yet... Be the first to leave a reply!