Changeset 11591
- Timestamp:
- 02/22/2022 03:46:33 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-openverse/functions.php
r11590 r11591 54 54 * disable those queries by returning an empty SQL 55 55 * query for the main WP_Query instance. 56 * 57 * Set no_found_rows to avoid querying for FOUND_ROWS(). 56 58 */ 57 59 function disable_default_query( $sql, $query ) { 58 60 if ( $query->is_main_query() ) { 59 61 $sql = ''; 62 $query->set( 'no_found_rows', true ); 60 63 } 61 64 … … 63 66 } 64 67 add_filter( 'posts_request', __NAMESPACE__ . '\disable_default_query', 10, 2 ); 68 69 /** 70 * Disable request parsing. 71 * 72 * This avoids `WP` parsing the requested URI to generate the WP_Query parameters. 73 * As all URIs will be passed through to the iframe, there's no point in parsing 74 * this or querying for posts that definitely do not exist within the WordPress site. 75 */ 76 add_filter( 'do_parse_request', '__return_false' ); 65 77 66 78 /**
Note: See TracChangeset
for help on using the changeset viewer.