Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created March 26, 2020 16:58
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/0f09195071d4ad2d02eafa55ec9def69 to your computer and use it in GitHub Desktop.
Save jchristopher/0f09195071d4ad2d02eafa55ec9def69 to your computer and use it in GitHub Desktop.
Use a custom PDF content parser to extract PDF content in SearchWP
<?php
// Use a custom PDF content parser to extract PDF content in SearchWP.
add_filter( 'searchwp\parser\pdf', function( $content, $data ) {
$my_parser = new \MyPdfParser( $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