Quantcast
Channel: A HitchHackers guide through WordPress » Filters by letter p
Viewing all articles
Browse latest Browse all 10

post_type_archive_title

$
0
0

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


Filed under: /wp-includes/general-template.php, Documentation, Files, Filters, Filters by letter p, Functions, Functions by letter p Tagged: codex, id8c0ecb09ad281177c665f9ac29e07b4a, post_type_archive_title

Viewing all articles
Browse latest Browse all 10

Trending Articles