Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created June 2, 2020 13:48
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/3084fadb57485c03c3a46e28458f9c8c to your computer and use it in GitHub Desktop.
Save jchristopher/3084fadb57485c03c3a46e28458f9c8c to your computer and use it in GitHub Desktop.
Drop Media from results that have no parent when parent attribution has been enabled in SearchWP.
<?php
// Drop Media from results that have no parent when parent attribution has been enabled in SearchWP.
// @link https://searchwp.com/documentation/hooks/searchwp-source-post-post_type-parent_attribution-strict
add_filter( 'searchwp\source\post\attachment\parent_attribution\strict', '__return_true' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment