searchwp\source\post\{$post_type}\parent_attribution\strict
提供開始日: 4.0.6
親の属性設定が有効になっている場合に、親を持たない投稿がどのように返されるかを制御します。
パラメータ
| タイプ | パラメータ | デフォルト | 提供開始 |
|---|---|---|---|
| ブール値 | $enabled |
false |
4.0.6 |
例
All hooks should be added to your custom SearchWP Customizations Plugin.
親の属性設定が有効になっている場合、親を持たないメディアを結果から除外します
メディアの親属性設定を有効にして、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 | |
| // Drop Media from results that have no parent when parent attribution has been enabled in SearchWP. | |
| // @link https://searchwp.com/documentation/hooks/searchwp-source-post-post_type-parent_attribution-strict | |
| add_filter( 'searchwp\source\post\attachment\parent_attribution\strict', '__return_true' ); |

