Make WordPress Core

Changeset 53057


Ignore:
Timestamp:
04/04/2022 01:23:55 AM (5 years ago)
Author:
peterwilsoncc
Message:

Customizer: Improve performance checking for published pages.

Improve the performance of WP_Customize_Manager::has_published_pages() by limiting the database query to a single published page, down from querying all published pages.

Props nagpai, dlh, tyxla.
Fixes #55425.

File:
1 edited

Legend:

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

    r53054 r53057  
    57515751                        }
    57525752                }
    5753                 return 0 !== count( get_pages() );
     5753                return 0 !== count( get_pages( array( 'number' => 1 ) ) );
    57545754        }
    57555755
Note: See TracChangeset for help on using the changeset viewer.