searchwp\source\post\attributes\meta\ignored
4.0.0以降
デフォルトでは、SearchWPは検索に適したコンテンツを含まないメタキーを無視します。このフックを使用して、無視するキーをカスタマイズできます。
パラメータ
| タイプ | パラメータ | デフォルト | 提供開始 | ||||||
|---|---|---|---|---|---|---|---|---|---|
| 配列 | $meta_keys |
WordPressとSearchWPの両方で使用され、有用なコンテンツを含まない内部メタキー | 4.0.0 |
||||||
| 配列 |
$args
|
4.0.0 |
|||||||
例
All hooks should be added to your custom SearchWP Customizations Plugin.
追加のメタキーを無視する
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 | |
| ); |

