searchwp\parser\pdf
Since: 4.0.0
Table of Contents
Utilize an external PDF parser to extract PDF content instead of SearchWP’s.
Parameters
Type | Parameter | Default | Since | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
String | $content |
'' |
4.0.0 |
|||||||||
Array |
$args
|
4.0.0 |
Examples
All hooks should be added to your custom SearchWP Customizations Plugin.
Use a custom PDF content parser to extract PDF content
<?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 ); |