Making WordPress.org

Changeset 7364


Ignore:
Timestamp:
07/03/2018 02:07:18 AM (6 years ago)
Author:
obenland
Message:

Main: Enqueue nav script on all 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

    r7360 r7364  
    8585    }
    8686
    87     if ( is_page() ) {
    88         $page = get_queried_object();
    89 
    90         if ( $page->post_parent && 'about' === get_post( $page->post_parent )->post_name ) {
    91             wp_enqueue_script( 'wporg-navigation', get_theme_file_uri( '/js/navigation.js' ), [], '20151215', true );
    92         }
     87    if ( is_page() && get_queried_object()->post_parent ) {
     88        wp_enqueue_script( 'wporg-navigation', get_theme_file_uri( '/js/navigation.js' ), [], '20151215', true );
    9389    }
    9490}
Note: See TracChangeset for help on using the changeset viewer.