Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created January 22, 2014 03:53
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/8553232 to your computer and use it in GitHub Desktop.
Save jchristopher/8553232 to your computer and use it in GitHub Desktop.
Implement your own PDF processing in SearchWP
<?php
function my_searchwp_external_pdf_processing( $content, $filename, $post_id ) {
if( class_exists( 'My_Awesome_PDF_Parser' ) ) {
$parser = new My_Awesome_PDF_Parser();
$content = $parser->extract_text_from_pdf( $filename );
}
return $content;
}
add_filter( 'searchwp_external_pdf_processing', 'my_searchwp_external_pdf_processing', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment