Note: You are viewing the documentation for Version 4View Version 3 Docs

searchwp\parser\text

Since: 4.0.0

Table of Contents

Utilize an external text parser to extract text content instead of SearchWP’s.

Parameters

Type Parameter Default Since
String $content '' 4.0.0
Array $args
Key Type Value
file String Path to file
data Array Data associated with the file
4.0.0

Examples

All hooks should be added to your custom SearchWP Customizations Plugin.

Use a custom text file parser to extract content

<?php
// Use a custom text file parser to extract content in SearchWP.
add_filter( 'searchwp\parser\text', function( $content, $data ) {
$my_parser = new \MyTextParser( $data['file'] );
return $my_parser->text();
}, 20, 2 );

How to use this code

Fix keyword search on your site. No coding required!

Now you can utilize all of the content that's gone unrecognized by native WordPress keyword search instantly with SearchWP

Get SearchWP