Make WordPress Core

Changeset 54935

Timestamp:
12/05/2022 09:29:36 PM (20 months ago)
Author:
audrasjb
Message:

Customize: Fix a wrong condition on WP_Customize_Manager::has_published_pages().

The Homepage Settings section on the customizer uses WP_Customize_Manager::has_published_pages() as active_callback. [53057] introduced an error on the logical check when the queried page is not a top-level page, which leads has_published_pages to incorrectly return an empty array.

This changeset fixes the issue by adding 'hierarchical' => 0 to get_pages() arguments.

Follow-up to [53057].

Props felipelavinz, dlh, costdev.
Fixes #57198.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r54135 r54935  
    57655765            }
    57665766        }
    5767         return 0 !== count( get_pages( array( 'number' => 1 ) ) );
     5767
     5768        return 0 !== count(
     5769            get_pages(
     5770                array(
     5771                    'number'       => 1,
     5772                    'hierarchical' => 0,
     5773                )
     5774            )
     5775        );
    57685776    }
    57695777
Note: See TracChangeset for help on using the changeset viewer.