Available since: 2.5
searchwp_pdf_metadata
View Parameters »Note: Use of this hook will require a manual reindex
When possible, SearchWP will index metadata from PDFs. You can use this hook to modify that metadata before SearchWP indexes it. In order for SearchWP to index PDF metadata, Media must be added to an engine and PDF Metadata added to Media (which is different than Document Content)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Modify PDF metadata before it gets indexed in SearchWP. | |
add_filter( 'searchwp_pdf_metadata', function( $pdf_metadata, $post_id ) { | |
// TODO: Modify $pdf_metadata as you see fit. | |
return $pdf_metadata; | |
}, 20, 2 ); |
Parameters
Parameter | Type | Description |
---|---|---|
$pdf_metadata |
Array |
PDF metadata to index |
$post_id |
Integer |
ID of entry being indexed |