woocommerce_status_widget_out_of_stock_count_pre_query
Status widget out of stock count pre query.
Использование
add_filter( 'woocommerce_status_widget_out_of_stock_count_pre_query', 'wp_kama_woocommerce_status_widget_out_of_stock_count_pre_query_filter', 10, 2 ); /** * Function for `woocommerce_status_widget_out_of_stock_count_pre_query` filter-hook. * * @param null|string $outofstock_count Out of stock count, by default null. * @param int $nostock No stock amount * * @return null|string */ function wp_kama_woocommerce_status_widget_out_of_stock_count_pre_query_filter( $outofstock_count, $nostock ){ // filter... return $outofstock_count; }
- $outofstock_count(null|строка)
- Out of stock count, by default null.
- $nostock(int)
- No stock amount
Список изменений
С версии 4.3.0 | Введена. |
Где вызывается хук
woocommerce_status_widget_out_of_stock_count_pre_query
woocommerce/includes/admin/class-wc-admin-dashboard.php 328
$outofstock_count = apply_filters( 'woocommerce_status_widget_out_of_stock_count_pre_query', null, $nostock );