woocommerce_product_category_metabox_search_threshold
Filters the category metabox search threshold, for when to render the typeahead field.
Использование
add_filter( 'woocommerce_product_category_metabox_search_threshold', 'wp_kama_woocommerce_product_category_metabox_search_threshold_filter' ); /** * Function for `woocommerce_product_category_metabox_search_threshold` filter-hook. * * @param number $threshold The default threshold. * * @return number */ function wp_kama_woocommerce_product_category_metabox_search_threshold_filter( $threshold ){ // filter... return $threshold; }
- $threshold(number)
- The default threshold.
Список изменений
С версии 7.6.0 | Введена. |
Где вызывается хук
woocommerce_product_category_metabox_search_threshold
woocommerce/includes/admin/meta-boxes/class-wc-meta-box-product-categories.php 48
if ( $categories_count <= apply_filters( 'woocommerce_product_category_metabox_search_threshold', 5 ) && function_exists( 'post_categories_meta_box' ) ) {