WordPress.org

Making WordPress.org

Changeset 7369


Ignore:
Timestamp:
07/03/2018 06:25:29 PM (2 years ago)
Author:
obenland
Message:

Main: Confine title check to pages.

Prevents PHP notices when called on 404 pages or in the admin.

See #3673.

File:
1 edited

Legend:

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

    r7365 r7369  
    199199function parent_page_title( $title, $post_id ) {
    200200    $title_post = get_post( $post_id );
    201     if ( 'about' === $title_post->post_name && get_post()->post_name !== $title_post->post_name ) {
     201    if ( is_page() && 'about' === $title_post->post_name && get_post()->post_name !== $title_post->post_name ) {
    202202        $title = esc_html_x( 'About', 'Page title', 'wporg' );
    203203    }
Note: See TracChangeset for help on using the changeset viewer.