searchwp\valid_html_tags
4.0.0以降
インデックス作成のためにコンテンツを抽出する際にSearchWPが考慮するHTMLタグを制御します。
パラメータ
| タイプ | パラメータ | デフォルト | 提供開始 |
|---|---|---|---|
| 配列 | $tags |
タグとタグ属性の多次元配列 | 4.0.0 |
例
すべてのフックはカスタムの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 | |
| // Prevent input attributes (e.g. placeholder) from being indexed by SearchWP. | |
| add_filter( 'searchwp\valid_html_tags', function( $tags ) { | |
| unset( $tags['input'] ); | |
| return $tags; | |
| } ); |

