mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-01 11:52:25 +08:00
11 lines
469 B
Text
11 lines
469 B
Text
add_filter( 'woocommerce_my_account_my_orders_actions', 'wc_order_again_action', 9999, 2 );
|
|
|
|
function wc_order_again_action( $actions, $order ) {
|
|
if ( $order->has_status( 'completed' ) ) {
|
|
$actions['order-again'] = array(
|
|
'url' => wp_nonce_url( add_query_arg( 'order_again', $order->get_id(), wc_get_cart_url() ), 'woocommerce-order_again' ),
|
|
'name' => __( 'Order again', 'woocommerce' ),
|
|
);
|
|
}
|
|
return $actions;
|
|
}
|