Making WordPress.org

Changeset 12206


Ignore:
Timestamp:
11/07/2022 02:02:57 AM (2 years ago)
Author:
dd32
Message:

Login: Use a more appropriate filter to short-circuit WP_Query on login.wordpress.org.

This avoids a fatal error when running PHP8, and allows for listing pages/posts within wp-admin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php

    r12037 r12206  
    239239
    240240// Don't perform any WP_Query queries on this site..
    241 add_filter( 'posts_request', '__return_empty_string' );
     241if ( ! is_admin() ) {
     242    add_filter( 'posts_pre_query', '__return_empty_array' );
     243}
     244
    242245// Don't attempt to do canonical lookups..
    243246remove_filter( 'template_redirect', 'redirect_canonical' );
     247
    244248// There's no need to edit the site..
    245249remove_action( 'wp_head', 'wlwmanifest_link' );
    246250remove_action( 'wp_head', 'rsd_link' );
     251
    247252// We don't need all the rest routes either..
    248253remove_action( 'rest_api_init', 'create_initial_rest_routes', 99 );
Note: See TracChangeset for help on using the changeset viewer.