Skip to content

Instantly share code, notes, and snippets.

@searchwpgists
Created March 28, 2022 13:50
Show Gist options
  • Select an option

  • Save searchwpgists/1a6b1d35e31e957d2e4a95f6940e0ca2 to your computer and use it in GitHub Desktop.

Select an option

Save searchwpgists/1a6b1d35e31e957d2e4a95f6940e0ca2 to your computer and use it in GitHub Desktop.
Skip document processing for a specific Attachment in SearchWP
<?php
// Skip document processing for Attachment 14 in SearchWP.
add_filter( 'searchwp\document\skip', function( $skip, $the_post ) {
if ( 14 === $the_post->ID ) {
return true;
}
return $skip;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment