Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created January 21, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchristopher/5761e132b2b391707d5e to your computer and use it in GitHub Desktop.
Save jchristopher/5761e132b2b391707d5e to your computer and use it in GitHub Desktop.
Usage example for searchwp_return_orderby_date
<?php
function my_searchwp_return_orderby_date( $order_by_date, $engine ) {
// for the Default engine (only!) we want to return search results by date
if ( 'default' == $engine ) {
$order_by_date = true;
}
return $order_by_date;
}
add_filter( 'searchwp_return_orderby_date', 'my_searchwp_return_orderby_date', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment