Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created January 29, 2018 13:27
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/038aa8a19435f3fc8498e1608feff63e to your computer and use it in GitHub Desktop.
Save jchristopher/038aa8a19435f3fc8498e1608feff63e to your computer and use it in GitHub Desktop.
Example of SearchWP's searchwp_get_supports_for_post_type hook
<?php
// Prevent SearchWP from allowing an Excerpt weight for Posts on the settings screen
add_filter( 'searchwp_get_supports_for_post_type', function( $applicable, $context ) {
if ( 'post' === $context['post_type'] && 'excerpt' === $context['supports'] ) {
$applicable = false;
}
return $applicable;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment