HUSKY - Products Filter Professional for WooCommerce
CODEX

Shortcodes, Hooks & Extensions

HUSKY – WooCommerce Products Filter Professional 的完整参考

  1. SC [[woof]] WooCommerce Products Filter 的主 shortcode。生成搜索表单。设计:1 页 - 1 个过滤器,不可能将多个过滤器放置在同一页面上…
  2. SC [[woof_author_filter]] 按作者 ID 过滤,并在网站前端显示为下拉列表。要使用此短代码,应激活扩展 Searching by Author placeholder…
  3. SC [[woof_btn]] 允许生成一个特殊的按钮来显示/隐藏搜索表单。显示一个隐藏过滤器的按钮。基于短代码属性 'autohide' 工作。使用示例:…
  4. SC [[woof_found_count]] 显示找到的产品计数。将它放入普通的文本小部件中,带有任何您需要的文本,或者在挂钩 woof_print_content_before_search_form 中使用它。版本:v.2.1.6  
  5. SC [[woof_front_builder]] 从 v.2.3.4/1.3.4 开始,此简码允许使用特殊构造函数直接在前台创建过滤器表单。这是演示页面,您可以在其中…
  6. SC [[woof_mobile]] 此短代码添加一个容器,其中插入了移动按钮。移动按钮出现在移动设备上,用于调用隐藏的 WOOF 过滤器表单并显示……
  7. SC [[woof_price_filter]] Price filter as drop-down OR as slider. This shortcode has 3 optional attributes type - slider, select,text additional_taxes - Example -> product_cat:9 - its like special…
  8. SC [[woof_products]] 插件的第二个主短代码。它允许在网站页面上显示产品。短代码的所有属性都是可选的。 per_page - 每页产品数…
  9. SC [[woof_products_messenger]] No attributes. Description is here.  
  10. SC [[woof_quick_search]] 应激活扩展:快速搜索预加载 - (1/0) 如果为 1,则在页面加载后立即加载数据文件,如果为 0 - 仅在用户开始…之后加载
  11. SC [[woof_quick_search_results]] 应激活扩展:Quick Search per_page - 每页产品 template_result - 应定义,并且有 5 种预定义模板:list_1 | list_2 |…
  12. SC [[woof_save_query]] 目的:允许登录用户保存他们当前的过滤器选择,以便以后快速访问。描述 此短代码显示一个您可以在其中保存用户…的小部件。
  13. SC [[woof_search_options]] 在搜索进行时(红色按钮)生成搜索导航。没有选项。  
  14. SC [[woof_sku_filter]] 在网站上生成文本输入框。只有一个可选属性。搜索条件在插件的设置页面,激活后即可访问……
  15. SC [[woof_step]] 此短代码允许为您的客户创建分步过滤器向导。属性:by_step - 此短代码中的主要属性,应放置键…
  16. SC [[woof_text_filter]] 在商店中生成文本输入框,以文本方式搜索 woocommerce 产品。开发名称是 HUSKY。可以按以下方式搜索:标题、内容、摘录、元字段、分类法…
  1. do_action woof_after_draw_filter 在 WOOF 过滤器表单中打印每个过滤器元素后执行。add_action('woof_after_draw_filter', function($key, $shortcode_atts) { //在此处执行操作 }, 99, 2); 从 v.2.2.5/1.2.5 开始  
  2. do_action woof_before_draw_filter 在 WOOF 过滤器表单的每个过滤器元素打印之前工作。add_action('woof_before_draw_filter', function($key, $shortcode_atts) { //do here }, 99, 2); 从 v.2.2.5/1.2.5  
  3. do_action woof_exclude_existing_variations 从 v.2.2.6 开始,改进了库存搜索。这是必要的,因为不是每个人都需要在搜索结果中包含变体,同时也允许避免过多的请求。默认是…
  4. do_action woof_image_allow_term_desc 从 v.2.2.6 默认情况下,为图片添加了术语描述,现在可以将其关闭。默认值为 true。示例:add_filter('woof_image_allow_term_desc',…
  5. do_action woof_meta_options_separator 从 v.2.2.6 开始,需要在选项中替换逗号分隔符,如果元数据包含逗号作为选项的一部分,则很有用,例如:add_filter('woof_meta_options_separator', function ($sep)…
  6. do_action woof_mobile_btn_place_container From v.2.2.6 Allows to override the selector where the mobile filter button should appear. By default is css class '.woocommerce-products-header'. Code example: add_filter('woof_mobile_btn_place_container', function ($selector)…
  7. do_action woof_override_seo_request_uri From v.2.2.6/1.2.6 Uses for extension 'SEO URL request' - passes the current URL. Need to adapt different servers if necessary
  8. do_action woof_print_design_additional_options 在扩展中使用,用于在“设计”选项卡中添加额外的选项(如有必要)。例如:add_action('woof_print_design_additional_options', array($this, 'my_design_additional_options'), 10, 1); public function my_design_additional_options() { global $WOOF;…
  9. do_action woof_print_html_type_options_{type} 所有扩展都使用它来绘制插件设置页面“设置”选项卡中的设置块 [inpost_fancy thumb_width="200" thumb_height="200" post_id="279" thumb_margin_left="5" thumb_margin_bottom="5" thumb_border_radius="200" thumb_shadow="0 1px…
  10. do_action woof_print_html_type_{type} 通过扩展在前端绘制自身,在扩展的 init 中编写以下代码就足够了:add_action('woof_print_html_type_' . $this->html_type, array($this, 'print_html_type'),…
  11. do_action woof_print_tax_additional_options_{type} 在扩展中使用,用于在“附加选项”按钮下方打印附加选项,如颜色:[inpost_fancy thumb_width="200" thumb_height="200" post_id="281" thumb_margin_left="5" thumb_margin_bottom="5" thumb_border_radius="200" thumb_shadow="0 1px 4px rgba(0,…
  12. do_action woof_seo_request_literals 从 v.2.2.6/1.2.6 开始用于扩展“SEO URL 请求” – 允许添加可能插入到 SEO 规则字段中的文字变量。示例…
  13. do_action woof_seo_rules_langs 从 v.2.2.6/1.2.6 使用于扩展 'SEO URL request' 并允许为 Polylang 等插件添加其他语言 示例:add_filter('woof_seo_rules_langs',function($langs){ $langs = array_merge($langs, array('en_US', 'es_ES'));…
  14. do_action woof_wp_load_js 此钩子允许在必要时将自定义 JavaScript 变量添加到网站前端 add_action('woof_wp_load_js', function ($str) { $str .= ';var my_var1="Hello";'; $str .= 'var…
  1. apply_filters woof_add_html_types 在分类类型扩展中使用,以添加其键到系统中,使扩展可见。例如:add_filter('woof_add_html_types', array($this, 'woof_add_html_types')); public function woof_add_html_types($types) {…
  2. apply_filters woof_add_items_keys 在 'by_' 扩展中使用,用于将其键添加到系统中,使扩展可见。例如:add_filter('woof_add_items_keys', array($this, 'woof_add_items_keys')); public function woof_add_items_keys($keys) { $keys[]…
  3. apply_filters woof_before_term_name 在 html types 中用作:radio, checkbox, select, mselect,用于在其标签前打印任何符号或图标 [inpost_fancy thumb_width="200" thumb_height="200" post_id="275" thumb_margin_left="5" thumb_margin_bottom="5" thumb_border_radius="200"…
  4. apply_filters woof_block_toggle_state 允许通过分类区块切换状态进行操作,例如在移动设备上关闭它们:add_filter('woof_block_toggle_state', function($block_is_closed) { if (wp_is_mobile()) { $block_is_closed = true; }…
  5. apply_filters woof_clear_all_text 允许更改搜索导航面板中“清除所有”按钮的文本 add_filter('woof_clear_all_text', function($default_text) { return 'Clear the filter'; }, 99, 1); 从 v.2.2.5/1.2.5…
  6. apply_filters woof_counter_method 供开发者在动态重新计数时进行内存过载实验。此钩子在文件: wp-content\plugins\woocommerce-products-filter\classes\counter.php 的 WP_QueryWoofCounter 类的 __constructor 中使用。当此钩子返回 TRUE 时…
  7. apply_filters woof_custom_filter_items_order 挂钩 woof_custom_filter_items_order 允许更改过滤器元素的顺序,传递一个过滤器键数组(您可以通过…找到过滤器部分键
  8. apply_filters woof_delete_img_url 允许更改删除图像的图像 url。 add_filter('woof_delete_img_url', function($current_img) { return 'https://my-site.com/wp-content/my-woof-del.png'; }, 10, 1); 从 v.2.2.5.6  
  9. apply_filters woof_disable_filter 目的:在特定页面或条件下禁用 WOOF 插件。此 hook 允许您完全禁用某些页面、帖子类型或… 上的 WOOF 插件功能。
  10. apply_filters woof_ext_custom_title_by_instock 允许为过滤器表单中的“有货”复选框设置自定义标题。您也可以使用 Loco Translate 插件翻译它  
  11. apply_filters woof_ext_custom_title_XXX 更改 3 个后续扩展的复选框标签:现货复选框、精选产品、促销复选框。使用:by_instock、by_featured、by_onsales 而不是 'XXX' 从 v.1.1.8/2.1.8  
  12. apply_filters woof_filter_shortcode_args 短代码 [woof] 的钩子,用于根据业务条件即时更改短代码参数 add_filter('woof_filter_shortcode_args', function($args) { //在此处使用 $args 执行操作 return $args;…
  13. apply_filters woof_filter_title Hook woof_filter_title (自 v.3.3.6 起) 分类和元过滤器的所有标题都通过此过滤器,因此您可以以自己的方式翻译标题,…
  14. apply_filters woof_get_filtered_price_query 从 ver.2.2.4/1.2.4 此钩子是为了与其他插件兼容而添加的。文件:\classes\helper.php public static function get_filtered_price
  15. apply_filters woof_get_meta_query 此 hook 允许在 WOOF 搜索查询中操作元查询:add_filter('woof_get_meta_query', function($meta_query) { // 您的代码 return $meta_query; }); 从 v.2.2.1/1.2.1  
  16. apply_filters woof_get_more_less_button_XXXX 使用此钩子来操作“未切换的术语计数”功能的按钮视图。XXXX - 可以替换为…
  17. apply_filters woof_get_request_data 在插件的 data-gate 函数中使用:index.php -> public function get_request_data() – 这是插件中第一个获取搜索请求数据的函数。可以是……
  18. apply_filters woof_get_tax_query 可用于分类法关系操作,例如将关系从 OR 更改为 AND。不与动态计数一起工作。 index.php private function get_tax_query add_filter('woof_get_tax_query', 'my_woof_get_tax_query');…
  19. apply_filters woof_get_terms_args 从 ver.2.2.4/1.2.4 此钩子是为了与其他插件兼容而添加的。 文件:\classes\helper.php public static function get_terms
  20. apply_filters woof_get_terms_order 用于在搜索表单中订购分类。 classes/helper.php public static function get_terms 与 woof_get_terms_orderby 配对使用 add_filter('woof_get_terms_order', function($taxonomy) { if ($taxonomy == 'pa_size')…
  21. apply_filters woof_get_terms_orderby 用于对搜索表单中的术语进行排序。classes/helper.php public static function get_terms 用于与 woof_get_terms_order 配对 add_filter('woof_get_terms_orderby', function($taxonomy) { if ($taxonomy == 'pa_size') {…
  22. apply_filters woof_html_types_view_checkbox 从 ver.2.2.4/1.2.4 开始,可以使用此钩子重写文件视图: \views\html_types\checkbox.php  
  23. apply_filters woof_html_types_view_mselect 从 ver.2.2.4/1.2.4 使用此 hook 可以重写文件: \views\html_types\mselect.php  
  24. apply_filters woof_html_types_view_radio 从 ver.2.2.4/1.2.4 开始,使用此 hook 可以重写文件:\views\html_types\radio.php  
  25. apply_filters woof_html_types_view_select 从 ver.2.2.4/1.2.4 使用此钩子可以重写文件视图: \views\html_types\select.php  
  26. apply_filters woof_husky_query_post__in 从 v.2.2.9/v.1.2.9 开始,有两种 Husky 筛选模式:添加带有 post__in 的搜索结果(默认启用)。此模式的优点是可靠,因为…
  27. apply_filters woof_husky_query_post__in 允许使用文章 ID 进行文本过滤,在工单中已请求 https://pluginus.net/support/topic/filter-on-title-description-separate-sku-filter/
  28. apply_filters woof_image_add_term_desc 对于过滤器图像(高级扩展)- 允许隐藏/显示工具提示中的术语描述。 默认为:true。 add_filter('woof_image_add_term_desc', function($tax_slug) { return false; }, 10, 1); [inpost_fancy thumb_width="200" thumb_height="200"…
  29. apply_filters woof_init_archive_by_default 允许在商品属性中禁用“启用归档”,如果需要在运行时以编程方式添加 add_filter('woof_init_archive_by_default', function($is) { return false; }, 99, 1);…
  30. apply_filters woof_main_query_tax_relations 此钩子允许在 WOOF 搜索请求中为任何分类法设置 'AND' 逻辑。在当前 wp 主题 functions.php 文件中使用它:add_filter('woof_main_query_tax_relations', 'my_woof_main_query_tax_relations');…
  31. apply_filters woof_max_price_filter 此钩子允许您根据自己的逻辑设置 HUSKY 价格过滤器的最高价格。在当前 WordPress… 的 functions.php 文件中使用以下代码
  32. apply_filters woof_min_price_filter 此钩子允许您根据自己的逻辑设置 HUSKY 价格过滤器的最低价格。在当前 WordPress 的 functions.php 文件中使用以下代码…
  33. apply_filters woof_not_sort_checked_terms 此钩子放置在插件的 index.php 中,在 public function woof_sort_terms_is_checked 中,并允许将 html-types 从“允许选中的项…”选项的影响中排除。
  34. apply_filters woof_order_catalog From v.2.2.4/1.2.4 Allows to add custom sort for catalog
  35. apply_filters woof_price_slider_html 如果您出于任何原因想在 WOOF 搜索表单中重新制作原生的 woo 价格滑块。 classes/helper.php public static function price_filter apply_filters('woof_price_slider_html', $price_slider_html, $price_slider_data);
  36. apply_filters woof_print_content_before_redraw_zone 从 v.2.2.4/1.2.4 开始,允许在产品上方放置任何不会被 AJAX 重新绘制的业务 HTML 消息  
  37. apply_filters woof_print_content_before_search_form 此钩子允许在 WOOF 搜索表单的项之前打印任何内容。示例:add_filter('woof_print_content_before_search_form', function($content) { global $WOOF; if ($WOOF AND woof()->is_isset_in_request_data(woof()->get_swoof_search_slug())) { return…
  38. apply_filters woof_print_label_attributes 允许在复选框和单选按钮标签中添加自定义属性,在工单 https://pluginus.net/support/topic/aria-describedby/#postid-82977 中请求。示例:add_action('woof_print_label_attributes', function ($term) { echo"aria-descrybedby aria-name='{$term['name']}'"; });  
  39. apply_filters woof_products_query 仅在 [woof_products] shortcode 中使用 1 次。 需要任何自定义操作。[inpost_fancy thumb_width="200" thumb_height="200" post_id="267" thumb_margin_left="5" thumb_margin_bottom="5" thumb_border_radius="200" thumb_shadow="0 1px 4px rgba(0, 0, 0,…
  40. apply_filters woof_products_top_panel_content ver.2.2.4/1.2.4 版显示过滤结果顶部的任何业务内容  
  41. apply_filters woof_qs_get_template_structure 对于扩展:快速搜索允许更改表格的列标题。例如:add_filter('woof_qs_get_template_structure', 'change_title'); function change_title($data) { if (isset($data['price'])) { $data['price']['title'] = "Price of…
  42. apply_filters woof_qs_shortcode_data 对于扩展:快速搜索 有必要在页面加载之前更改模板参数 - 例如,取决于设备。 [inpost_fancy thumb_width="200" thumb_height="200"…
  43. apply_filters woof_qs_sort_select_data 对于扩展:快速搜索允许更改表格的排序标题(当表单以下拉列表形式显示时) add_filter('woof_qs_sort_select_data', 'change_title'); function change_title($data) { if…
  44. apply_filters woof_quick_search_products_limit 默认情况下,产品数量限制为 10,000。但您可以扩展此值:add_filter('woof_quick_search_products_limit', function($count){ return 30000; }); 但请记住 - 更多产品……
  45. apply_filters woof_redraw_elements_after_ajax 允许在用户以 AJAX 模式进行过滤时添加任何消息。例如:add_filter('woof_redraw_elements_after_ajax', function($fields, $query) { ob_start(); if (isset($query->query['tax_query']) AND $query->query['tax_query']) { $html =…
  46. apply_filters woof_seo_do_index Hook woof_seo_do_index 用于扩展 SEO URL。这提供了更灵活的索引控制。例如,用户不想索引仅…
  47. apply_filters woof_seo_meta_description 目的:修改过滤后产品页面的 meta description 标签。此钩子允许您自定义带有活动 WOOF...的页面的 <meta name="description"> 内容。
  48. apply_filters woof_set_shortcode_taxonomyattr_behaviour 此挂钩在插件的 index.php 中的 public function woof_shortcode 中工作,允许操作“additional_taxes”。[inpost_fancy thumb_width="200" thumb_height="200" post_id="1064" thumb_margin_left="5" thumb_margin_bottom="5" thumb_border_radius="200" thumb_shadow="0…
  49. apply_filters woof_slider_meta_query_type Hook woof_slider_meta_query_type is for meta slider values types, for example decimal values: add_filter('woof_slider_meta_query_type',function($type,$key){ return "DECIMAL(5,3)"; },2,10); [inpost_fancy thumb_width="200" thumb_height="200" post_id="1620" thumb_margin_left="5" thumb_margin_bottom="5" thumb_border_radius="200" thumb_shadow="0 1px…
  50. apply_filters woof_sort_terms_before_out 在 html types 中用作 checkbox 或 radio,用于对术语数组进行任何操作(如果需要)$terms = apply_filters('woof_sort_terms_before_out', $terms, 'checkbox'); wp-content\plugins\woocommerce-products-filter\views\html_types\checkbox.php
  51. apply_filters woof_sort_terms_checked
  52. apply_filters woof_start_filtering_btn_txt “显示产品过滤器表单”按钮的钩子,出现在短代码 [woof start_filtering_btn=1] 中 add_filter('woof_start_filtering_btn_txt', function($txt){ return "Load form!!"; }); 从:v.2.1.6  
  53. apply_filters woof_step_filter_img_size From v.2.2.4/1.2.4 For resizing images in woof step filter. add_filter('woof_step_filter_img_size', function($size) { $size = 'large'; //thumbnail, medium, large, full, array(200, 200) //woocommerce_thumbnail ,woocommerce_single, woocommerce_gallery_thumbnail return…
  54. apply_filters woof_taxonomy_image 允许根据当前情况即时重定义图像过滤器的图像 add_filter('woof_taxonomy_image', function($image, $term) { //更改图像上的…
  55. apply_filters woof_template_part 允许在短代码 [woof_products] 中即时更改模板 [inpost_fancy thumb_width="200" thumb_height="200" post_id="1235" thumb_margin_left="5" thumb_margin_bottom="5" thumb_border_radius="200" thumb_shadow="0 1px 4px rgba(0, 0, 0, 0.2)"…
  56. apply_filters woof_terms_where_hidden_childs 用于任何带有子分类的分类项,当有必要在以下选项中完全隐藏这些子分类:checkboxes, radio, select, mselect, labels。 add_filter('woof_terms_where_hidden_childs', function($term_id) { $hide_array=array(11,22,33,44,55,66,77); if (in_array($term_id,…
  57. apply_filters woof_term_count_format 更改了计数器格式 – 默认情况下,它传输‘(%d)‘ 例如:add_filter('woof_term_count_format', function ($format, $tax_slug) { $format = '|%d|'; return $format;…
  58. apply_filters woof_text_autocomplete_items 文本输入框的自动完成功能应返回多少个帖子 add_filter('woof_text_autocomplete_items', function($count){ return 5; });
  59. apply_filters woof_text_search_like_option 此项调节文本搜索行为,默认返回 FALSE。如果返回 TRUE,则文本搜索将起作用,而不考虑特殊字符…
  60. apply_filters woof_text_search_query 允许动态重写文本搜索 SQL 请求 add_filter('woof_text_search_query', function($where, $woof_text) { global $wpdb; $where .= "AND $wpdb->posts.ID IN(15,39,121)"; return $where; }, 99,…
  61. apply_filters woof_title_tag 如果您想将每个分类块的标题标签 H4 重定义为任何其他 HTML 标签,请使用 hook woof_title_tag。示例:add_filter('woof_title_tag', function($tag){ return 'h5'; });…
  62. apply_filters woof_turbo_mode_schedules 挂钩 woof_turbo_mode_schedules(自 v.3.3.6 起)允许在涡轮模式下为产品参数更新添加自定义周期,代码示例:add_filter('woof_turbo_mode_schedules', function($schedules) { $schedules['your_custom_period_key'] = array( 'name'…
  63. apply_filters woof_use_wp_cache Hook woof_use_wp_cache 用于启用对 wp-cache 进行对象缓存,这更加优化。在测试中显示了良好的结果。注意:必须安装……
  64. apply_filters woof_widget_title_tag 使用 hook woof_widget_title_tag 如果您想将 WOOF 小部件标题的标题标签 H3 重定义为任何其他 HTML 标签。例如:add_filter('woof_widget_title_tag', function($tag){ return 'h4'; });