Changeset 9066
- Timestamp:
- 07/19/2019 03:51:20 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php
r8695 r9066 100 100 // Deindex Support Forum Feeds. bbPress hooks in way earlier than most Core feed functions.. 101 101 add_filter( 'request', array( $this, 'deindex_forum_feeds' ), 5 ); 102 103 add_filter( 'request', array( $this, 'ignore_empty_query_vars' ) ); 104 102 105 } 103 106 … … 971 974 return $query_vars; 972 975 } 976 977 /** 978 * Ignore certain empty set query vars. 979 * 980 * TODO: This is probably a bbPress bug in that it doesn't handle "empty" QVs well. 981 */ 982 function ignore_empty_query_vars( $query_vars ) { 983 // bbPress query vars that sometimes have weird urls as a result. 984 $ignore_emptyish_values = [ 'topic', 'reply', 'forum', 'topic-tag', 'bbp_view' ]; 985 986 foreach ( $ignore_emptyish_values as $q ) { 987 if ( isset( $query_vars[ $q ] ) && empty( $query_vars[ $q ] ) ) { 988 // It's set, but empty so not a useful QV? 989 unset( $query_vars[ $q ] ); 990 } 991 } 992 993 return $query_vars; 994 } 995 973 996 }
Note: See TracChangeset
for help on using the changeset viewer.