[wp-trac] [WordPress Trac] #57198: WP_Customize_Manager::has_published_pages() fails when queried page is not top-level

WordPress Trac noreply at wordpress.org
Mon Dec 5 21:29:51 UTC 2022


#57198: WP_Customize_Manager::has_published_pages() fails when queried page is not
top-level
-----------------------------------------------+-----------------------
 Reporter:  felipelavinz                       |       Owner:  audrasjb
     Type:  defect (bug)                       |      Status:  closed
 Priority:  normal                             |   Milestone:  6.2
Component:  Customize                          |     Version:  6.0
 Severity:  normal                             |  Resolution:  fixed
 Keywords:  has-patch has-testing-info commit  |     Focuses:
-----------------------------------------------+-----------------------
Changes (by audrasjb):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"54935" 54935]:
 {{{
 #!CommitTicketReference repository="" revision="54935"
 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.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57198#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list