searchwp\parser\richtext
Since: 4.0.0
Table of Contents
Utilize an external rich text parser to extract rich text 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 rich text file parser to extract 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 | |
// Use a custom rich text file parser to extract content in SearchWP. | |
add_filter( 'searchwp\parser\text', function( $content, $data ) { | |
$my_parser = new \MyRichTextParser( $data['file'] ); | |
return $my_parser->text(); | |
}, 20, 2 ); |