searchwp\source\post\attributes\meta\ignored
Depuis : 4.0.0
Table des matières
Par défaut, SearchWP ignore les clés de métadonnées qui ne contiennent pas de contenu pertinent pour la recherche. Vous pouvez personnaliser les clés ignorées avec ce hook.
Paramètres
| Type | Paramètre | Défaut | Depuis | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Tableau | $meta_keys |
Clés meta internes utilisées par WordPress et SearchWP qui ne contiennent pas de contenu utile | 4.0.0 |
||||||
| Tableau |
$args
|
4.0.0 |
|||||||
Exemples
All hooks should be added to your custom SearchWP Customizations Plugin.
Ignorer les clés meta supplémentaires
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 | |
| // Ignore additional meta keys in SearchWP. | |
| add_filter( | |
| 'searchwp\source\post\attributes\meta\ignored', | |
| function( $meta_keys, $args ) { | |
| $meta_keys[] = 'my_not_useful_meta_key'; | |
| return $meta_keys; | |
| }, | |
| 20, 2 | |
| ); |

