Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: post_type_archive_title

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
708 function post_type_archive_title( $prefix = '', $display = true ) {
709      if ( ! is_post_type_archive() )
710           return;
711
712      $post_type = get_query_var( 'post_type' );
713      if ( is_array( $post_type ) )
714           $post_type = reset( $post_type );
715
716      $post_type_obj = get_post_type_object( $post_type );
717      $title = apply_filters('post_type_archive_title', $post_type_obj->labels->name );
718
719      if ( $display )
720           echo $prefix . $title;
721      else
722           return $prefix . $title;
723 }
724
725 /**
726  * Display or retrieve page title for category archive.