searchwp\source\post\attributes\meta\{$meta_key}
Depuis : 4.0.0
Table des matières
Manipuler les données d'un champ personnalisé (postmeta) pour un champ personnalisé unique avant son indexation.
Voir aussi searchwp\source\post\attributes\meta\${meta_key} pour tous les champs personnalisés.
Paramètres
| Type | Paramètre | Défaut | Depuis | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Mixte | $meta_value |
Valeur du champ personnalisé | 4.0.0 |
||||||
| Tableau |
$args
|
4.0.0 |
|||||||
Exemples
All hooks should be added to your custom SearchWP Customizations Plugin.
Ajouter du contenu supplémentaire à un champ personnalisé spécifique lors de l'indexation dans SearchWP
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 | |
| // Add additional content to a specific Custom Field during indexing in SearchWP. | |
| add_filter( 'searchwp\source\post\attributes\meta\my_custom_field_key', function( $meta_value, $args ) { | |
| // Add 'coffee' to Custom Field value to make it searchable. | |
| return $meta_value[0] . ' coffee'; | |
| }, 20, 2 ); |

