Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created June 3, 2020 13:34
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/2ddf485de4a13813e2dd54dcbbeab33b to your computer and use it in GitHub Desktop.
Save jchristopher/2ddf485de4a13813e2dd54dcbbeab33b to your computer and use it in GitHub Desktop.
Index Mod vs. Source Mod in SearchWP
<?php
// @link https://searchwp.com/documentation/knowledge-base/comparing-index-source-mods/
// Instantiate an index Mod that applies to the entire index.
$mod = new \SearchWP\Mod();
// Instantiate a Source Mod that applies only to Posts.
$source = \SearchWP\Utils::get_post_type_source_name( 'post' );
$mod = new \SearchWP\Mod( $source );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment