SearchWP Documentation

インストールガイドを表示したり、ナレッジベースを参照したり、SearchWPの多くのフックについて確認したりできます。

searchwp\source\post\attributes\meta\{$meta_key}

4.0.0以降

単一のカスタムフィールドがインデックスされる前に、そのカスタムフィールド(postmeta)データを操作します。

すべてのカスタムフィールドについては、searchwp\source\post\attributes\meta\${meta_key}参照してください。

パラメータ

タイプ パラメータ デフォルト 提供開始
混合 $meta_value カスタムフィールドの値 4.0.0
配列 $args
キー タイプ
post_id 整数 投稿ID
4.0.0

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

SearchWP でインデックス中に特定のカスタムフィールドに追加コンテンツを挿入します

<?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 );

このコードの使用方法