Available since: 2.8.16
searchwp_query_allow_query_string_override_order
View Parameters »By default SearchWP sorts results in DESC
order according to the calculated weight (e.g. higher weight means more relevance which results in a higher search results rank) which can be overridden using the searchwp_query_orderby
hook, or this hook if you’d prefer the control to be offered via query string.
SearchWP allows for a query string override by default, but you can disable it with the following:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Prevent SearchWP from accepting a query string to accept results order. | |
add_filter( 'searchwp_query_allow_query_string_override_order', '__return_false' ); |
Parameters
Parameter | Type | Description |
---|---|---|
$allow |
Boolean |
Whether SearchWP should accept the query string |