Changeset 8224
- Timestamp:
- 02/12/2019 01:29:28 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-page-limiter.php
r8174 r8224 38 38 } 39 39 40 // Pre-query, ensure we flag this request as a 404 - Won't stop the actual WP_Query though, just sets the 404 headers.40 // Pre-query, Override the query to be a 404. 41 41 public function request( $args ) { 42 42 if ( isset( $args['paged'] ) && $args['paged'] > self::MAX_PAGES ) { 43 $args['error'] = 404; 43 $args = array( 44 'error' => 404, 45 ); 44 46 } 45 47 return $args; … … 56 58 if ( $paged && $paged > self::MAX_PAGES ) { 57 59 $query->set_404(); 58 /*59 // TODO: WP_Query will still query the DB even if it's been told it's a 404 either via set_404() or via WP::parse_request().60 add_filter( 'posts_request', function( $request ) {61 // remove_filter( 'posts_request', __METHOD__ );62 return ''; // empty SQL63 }, 100 );64 */65 60 } 66 61
Note: See TracChangeset
for help on using the changeset viewer.