woocommerce_valid_order_statuses_for_order_again
Display an 'order again' button on the view order page.
Usage
add_filter( 'woocommerce_valid_order_statuses_for_order_again', 'wp_kama_woocommerce_valid_order_statuses_for_again_filter' ); /** * Function for `woocommerce_valid_order_statuses_for_order_again` filter-hook. * * @param object $order Order. * * @return object */ function wp_kama_woocommerce_valid_order_statuses_for_again_filter( $order ){ // filter... return $order; }
- $order(object)
- Order.
Where the hook is called
woocommerce_valid_order_statuses_for_order_again
woocommerce_valid_order_statuses_for_order_again
woocommerce/includes/wc-template-functions.php 2801
if ( ! $order || ! $order->has_status( apply_filters( 'woocommerce_valid_order_statuses_for_order_again', array( 'completed' ) ) ) || ! is_user_logged_in() ) {
woocommerce/includes/class-wc-cart-session.php 443
if ( ! $order->get_id() || ! $order->has_status( apply_filters( 'woocommerce_valid_order_statuses_for_order_again', array( 'completed' ) ) ) || ! current_user_can( 'order_again', $order->get_id() ) ) {