Skip to content

Instantly share code, notes, and snippets.

@searchwpgists
Created March 9, 2022 15:47
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 searchwpgists/16560ad8c5ec3dd24ed8563fbdc59f6b to your computer and use it in GitHub Desktop.
Save searchwpgists/16560ad8c5ec3dd24ed8563fbdc59f6b 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