WordPress.org

Making WordPress.org

Changeset 7422


Ignore:
Timestamp:
07/11/2018 03:44:09 PM (2 years ago)
Author:
obenland
Message:

Main: Add 'Download' to parent page titles.

Allows it to be translated when displayed on child pages.

See #3673.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/functions.php

    r7409 r7422  
    196196function parent_page_title( $title, $post_id ) {
    197197    $title_post = get_post( $post_id );
    198     if ( is_page() && 'about' === $title_post->post_name && get_post()->post_name !== $title_post->post_name ) {
     198
     199    if ( is_page() && $title_post && 'about' === $title_post->post_name ) {
    199200        $title = esc_html_x( 'About', 'Page title', 'wporg' );
    200201    }
    201202
     203    if ( is_page() && $title_post && 'download' === $title_post->post_name ) {
     204        $title = esc_html_x( 'Download', 'Page title', 'wporg' );
     205    }
     206
    202207    return $title;
    203208}
Note: See TracChangeset for help on using the changeset viewer.