WC_Meta_Box_Order_Actions::get_trash_or_delete_order_link()private staticWC 1.0

Forms a trash/delete order URL.

Метод класса: WC_Meta_Box_Order_Actions{}

Хуков нет.

Возвращает

Строку.

Использование

$result = WC_Meta_Box_Order_Actions::get_trash_or_delete_order_link( $order_id ): string;
$order_id(int) (обязательный)
The order ID for which we want a trash/delete URL.

Код WC_Meta_Box_Order_Actions::get_trash_or_delete_order_link() WC 8.7.0

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',
				'id'            => 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 );
}