Changeset 783
- Timestamp:
- 08/12/2014 06:32:18 AM (10 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/header.php
r781 r783 7 7 * @package wporg-developer 8 8 */ 9 10 $GLOBALS['pagetitle'] = wp_title( '|', false, 'right' ); 11 9 12 require WPORGPATH . 'header.php'; 10 13 ?> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/extras.php
r781 r783 50 50 } 51 51 52 // Add the blog name 53 $title .= get_bloginfo( 'name' ); 52 $post_type = get_query_var( 'post_type' ); 53 54 // Add post type to title if it's a parsed item. 55 if ( 0 === strpos( $post_type, 'wp-parser-' ) ) { 56 if ( $post_type_object = get_post_type_object( $post_type ) ) { 57 $title .= get_post_type_object( $post_type )->labels->singular_name . " $sep "; 58 } 59 } 60 // Add handbook name to title if relevent 61 elseif ( false !== strpos( $post_type, 'handbook' ) ) { 62 if ( $post_type_object = get_post_type_object( $post_type ) ) { 63 $label = get_post_type_object( $post_type )->labels->name . " $sep "; 64 // Don't add the label for a page of the same name as post type name. 65 if ( $title != $label ) { 66 $title .= $label; 67 } 68 } 69 } 54 70 55 71 // Add the blog description for the home/front page. … … 63 79 $title .= " $sep " . sprintf( __( 'Page %s', 'wporg' ), max( $paged, $page ) ); 64 80 } 81 82 // Add the blog name 83 $title .= get_bloginfo( 'name' ); 65 84 66 85 return $title; … … 76 95 function wporg_filter_archive_excerpt( $excerpt ) { 77 96 if ( ! is_single() ) { 78 $excerpt = '<b>' . get_post_type_ labels( get_post_type_object( get_post_type( get_the_ID() ) ) )->singular_name . ': </b>' . $excerpt;97 $excerpt = '<b>' . get_post_type_object( get_post_type( get_the_ID() ) )->labels->singular_name . ': </b>' . $excerpt; 79 98 } 80 99 … … 90 109 */ 91 110 function wporg_filter_archive_title( $title ) { 92 if ( ! is_single() && in_array( get_post_type(), array( 'wp-parser-function', 'wp-parser-method' ) ) ) {111 if ( ( ! is_single() || doing_filter( 'single_post_title' ) ) && in_array( get_post_type(), array( 'wp-parser-function', 'wp-parser-method' ) ) ) { 93 112 $title .= '()'; 94 113 } … … 97 116 } 98 117 add_filter( 'the_title', 'wporg_filter_archive_title' ); 118 add_filter( 'single_post_title', 'wporg_filter_archive_title' );
Note: See TracChangeset
for help on using the changeset viewer.