Changeset 7360 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/functions.php
- Timestamp:
- 07/02/2018 11:54:43 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/functions.php
r7359 r7360 193 193 194 194 /** 195 * Customizes the parent page title when rendering as a site title on child pages. 196 * 197 * Example: 'About' on all child pages of the About page. 198 * 199 * @param string $title Post Title. 200 * @param int $post_id Post ID. 201 * @return string 202 */ 203 function parent_page_title( $title, $post_id ) { 204 $title_post = get_post( $post_id ); 205 if ( 'about' === $title_post->post_name && get_post()->post_name !== $title_post->post_name ) { 206 $title = esc_html_x( 'About', 'Page title', 'wporg' ); 207 } 208 209 return $title; 210 } 211 add_filter( 'the_title', __NAMESPACE__ . '\parent_page_title', 11, 2 ); 212 213 /** 195 214 * Custom template tags. 196 215 */
Note: See TracChangeset
for help on using the changeset viewer.