Making WordPress.org


Ignore:
Timestamp:
03/04/2021 11:40:35 PM (6 years ago)
Author:
coffee2code
Message:

Handbooks, Handbook: Fix logic for determining if page is handbook landing pages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/template-tags.php

    r10000 r10763  
    8383 * @return bool True if the current page is the landing page for a handbook, false otherwise.
    8484 */
    85  function wporg_is_handbook_landing_page() {
    86          return $GLOBALS['wp_query']->is_handbook_root;
     85function wporg_is_handbook_landing_page() {
     86        return (
     87                $GLOBALS['wp_query']->is_handbook_root
     88        ||
     89                (
     90                        ! empty( $GLOBALS['wp_query']->query_vars['handbook'] )
     91                &&
     92                        $GLOBALS['wp_query']->found_posts === 1
     93                &&
     94                        ! empty( $GLOBALS['wp_query']->query_vars['page_id'] )
     95                )
     96        );
    8797 }
    8898
Note: See TracChangeset for help on using the changeset viewer.