Changeset 9803
- Timestamp:
- 05/01/2020 05:12:07 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/query-modifications.php
r9522 r9803 207 207 } 208 208 add_action( 'parse_request', 'wporg_themes_parse_request' ); 209 210 /** 211 * Remove support for any query vars the Theme Directory doesn't support/need. 212 * 213 * This should only apply to Rewrite rules, so WP_Query can use anything it needs. 214 */ 215 function wporg_themes_remove_query_vars( $qv ) { 216 $not_needed = [ 217 'm', 'w', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 218 'posts', 'withcomments', 'withoutcomments', 219 'search', 'exact', 'sentence', 'calendar', 'more', 'tb', 'pb', 220 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 221 'favicon', 'cpage', 'embed', 'post_format', 222 ]; 223 224 return array_diff( $qv, $not_needed ); 225 } 226 add_filter( 'query_vars', 'wporg_themes_remove_query_vars', 0 );
Note: See TracChangeset
for help on using the changeset viewer.