[wp-trac] [WordPress Trac] #60228: has_published_pages method does not always return intended result

WordPress Trac noreply at wordpress.org
Wed Jan 10 18:07:22 UTC 2024


#60228: has_published_pages method does not always return intended result
--------------------------+-----------------------------
 Reporter:  sconroy       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Customize     |    Version:
 Severity:  minor         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The has_published_pages method in class-wp-customizer-manager.php has the
 potential to return an inaccurate result. It only checks the retrieval of
 a single page. Thus if there are any 'get_pages' filters utilized to
 remove that first page from the return, then the has_published_pages
 method returns false when there are other published pages. Even if there
 are tens of pages published the function will still return false if that
 first page is filtered out of the get_pages call.

 This potentially inaccurate return can cause the Homepage Settings sub-
 menu to disappear from the Appearance->Customize menu.

 A more accurate measure of if the user has published pages would not rely
 on a single page.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60228>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list