Skip to content

Instantly share code, notes, and snippets.

@searchwpgists
Created March 28, 2022 14:51
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/8413afc9788a8a3f65416e497111198b to your computer and use it in GitHub Desktop.
Save searchwpgists/8413afc9788a8a3f65416e497111198b to your computer and use it in GitHub Desktop.
Use a custom rich text file parser to extract content in SearchWP
<?php
// Use a custom rich text file parser to extract content in SearchWP.
add_filter( 'searchwp\parser\text', function( $content, $data ) {
$my_parser = new \MyRichTextParser( $data['file'] );
return $my_parser->text();
}, 20, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment