WC_Meta_Box_Order_Actions::get_trash_or_delete_order_link()
Forms a trash/delete order URL.
Method of the class: WC_Meta_Box_Order_Actions{}
No Hooks.
Return
String
.
Usage
$result = WC_Meta_Box_Order_Actions::get_trash_or_delete_order_link( $order_id ): string;
- $order_id(int) (required)
- The order ID for which we want a trash/delete URL.
WC_Meta_Box_Order_Actions::get_trash_or_delete_order_link() WC Meta Box Order Actions::get trash or delete order link code WC 7.5.1
private static function get_trash_or_delete_order_link( int $order_id ): string { if ( OrderUtil::custom_orders_table_usage_is_enabled() ) { $order_type = wc_get_order( $order_id )->get_type(); $order_list_url = wc_get_container()->get( PageController::class )->get_base_page_url( $order_type ); $trash_order_url = add_query_arg( array( 'action' => 'trash', 'order' => array( $order_id ), '_wp_http_referer' => $order_list_url, ), $order_list_url ); return wp_nonce_url( $trash_order_url, 'bulk-orders' ); } return get_delete_post_link( $order_id ); }