Skip to content

Instantly share code, notes, and snippets.

@searchwpgists
Created March 16, 2022 16:40
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/3149c918af5ef2669e206e8430ebc0fa to your computer and use it in GitHub Desktop.
Save searchwpgists/3149c918af5ef2669e206e8430ebc0fa to your computer and use it in GitHub Desktop.
Include unapproved comments when SearchWP indexes
<?php
// Include unapproved comments when SearchWP indexes.
add_filter( 'searchwp\source\post\attributes\comments\args', function( $comment_args, $args ) {
$args['include_unapproved'] = true;
return $args;
}, 20, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment