searchwp\parser\text
Depuis : 4.0.0
Table des matières
Utilisez un analyseur de texte externe pour extraire le contenu textuel au lieu de celui de SearchWP.
Paramètres
| Type | Paramètre | Défaut | Depuis | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chaîne | $content |
'' |
4.0.0 |
|||||||||
| Tableau |
$args
|
4.0.0 |
||||||||||
Exemples
All hooks should be added to your custom SearchWP Customizations Plugin.
Utiliser un analyseur de texte personnalisé pour extraire le contenu
This file contains hidden or 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 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 ); |

