Skip to content

Instantly share code, notes, and snippets.

@searchwpgists
Created April 12, 2022 16:41
Show Gist options
  • Save searchwpgists/7587fb8370d0d1484defba01d7f63929 to your computer and use it in GitHub Desktop.
Save searchwpgists/7587fb8370d0d1484defba01d7f63929 to your computer and use it in GitHub Desktop.
<?php
// ... this overrides the \SearchWP\Query instantiation found
// @link https://searchwp.com/documentation/search/supplemental-engine/
// e.g. $search_page is defined in the full snippet, this solely
// replaces the query to search across sites and return 'default' results.
$searchwp_query = new \SearchWP\Query( $search_query, [
'engine' => 'supplemental', // The Engine name.
'fields' => 'default', // Retain site ID info with results.
'site' => 'all', // Search all sites.
'page' => $search_page,
] );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment