woocommerce_admin_order_should_render_refunds
Allow plugins to determine whether refunds UI should be rendered in the template.
Использование
add_filter( 'woocommerce_admin_order_should_render_refunds', 'wp_kama_woocommerce_admin_order_should_render_refunds_filter', 10, 3 ); /** * Function for `woocommerce_admin_order_should_render_refunds` filter-hook. * * @param bool $render_refunds If the refunds UI should be rendered. * @param int $order_id The Order ID. * @param WC_Order $order The Order object. * * @return bool */ function wp_kama_woocommerce_admin_order_should_render_refunds_filter( $render_refunds, $order_id, $order ){ // filter... return $render_refunds; }
- $render_refunds(true|false)
- If the refunds UI should be rendered.
- $order_id(int)
- The Order ID.
- $order(WC_Order)
- The Order object.
Список изменений
С версии 6.4.0 | Введена. |
Где вызывается хук
woocommerce_admin_order_should_render_refunds
woocommerce/includes/admin/meta-boxes/views/html-order-items.php 19
$render_refunds = (bool) apply_filters( 'woocommerce_admin_order_should_render_refunds', 0 < $order->get_total() - $order->get_total_refunded() || 0 < absint( $order->get_item_count() - $order->get_item_count_refunded() ), $order->get_id(), $order );