woof-print-content-before-redraw-zone
woof_print_content_before_redraw_zone
AJAXフィルタリング時に、再描画ゾーンの前に任意のHTMLコンテンツを出力できます。
パラメーター
$content (string) — デフォルトは空の文字列
ソースファイル
views/woof.php
コード例
add_filter('woof_print_content_before_redraw_zone', function($content) {
// Show a loading indicator before products redraw
return '' . esc_html__('Updating results...', 'woocommerce-products-filter') . '
';
});
使用上の注意
- このコードをテーマの
functions.phpファイルまたはカスタムプラグインに追加してください。 - このフックはフィルタリング処理中に適用され、変更はすぐに反映されます。
- コールバック関数からは、常に期待される値の型を返してください。