Skip to content

Instantly share code, notes, and snippets.

@searchwpgists
Created March 28, 2022 14:49
Show Gist options
  • Save searchwpgists/1a05d78832760815019ee18ca68ac270 to your computer and use it in GitHub Desktop.
Save searchwpgists/1a05d78832760815019ee18ca68ac270 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