Changeset 781 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/extras.php
- Timestamp:
- 08/12/2014 06:26:08 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/extras.php
r554 r781 67 67 } 68 68 add_filter( 'wp_title', 'wporg_developer_wp_title', 10, 2 ); 69 70 /** 71 * Prefixes excerpts for archive view with content type label. 72 * 73 * @param string $excerpt The excerpt. 74 * @return string 75 */ 76 function wporg_filter_archive_excerpt( $excerpt ) { 77 if ( ! is_single() ) { 78 $excerpt = '<b>' . get_post_type_labels( get_post_type_object( get_post_type( get_the_ID() ) ) )->singular_name . ': </b>' . $excerpt; 79 } 80 81 return $excerpt; 82 } 83 add_filter( 'get_the_excerpt', 'wporg_filter_archive_excerpt' ); 84 85 /** 86 * Appends parentheses to titles in archive view for functions and methods. 87 * 88 * @param string $title The title. 89 * @return string 90 */ 91 function wporg_filter_archive_title( $title ) { 92 if ( ! is_single() && in_array( get_post_type(), array( 'wp-parser-function', 'wp-parser-method' ) ) ) { 93 $title .= '()'; 94 } 95 96 return $title; 97 } 98 add_filter( 'the_title', 'wporg_filter_archive_title' );
Note: See TracChangeset
for help on using the changeset viewer.