From d44ae67f486a86c122a63885a4fbf672ab60c6a0 Mon Sep 17 00:00:00 2001 From: MihaiCraciun88 <31093928+MihaiCraciun88@users.noreply.github.com> Date: Tue, 16 Jan 2024 12:40:04 +0200 Subject: [PATCH] Update woocommerce-oblio.php --- woocommerce-oblio.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/woocommerce-oblio.php b/woocommerce-oblio.php index 8a1cf17..a4647a5 100644 --- a/woocommerce-oblio.php +++ b/woocommerce-oblio.php @@ -142,7 +142,8 @@ function _wp_oblio_delete_invoice($order_id, $options = []) { } function _wp_oblio_build_url($action, $post) { - return get_site_url(null, 'wp-admin/admin-ajax.php?action=oblio_invoice&a=' . $action . '&id=' . $post->get_id()); + return get_site_url(null, 'wp-admin/admin-ajax.php?action=oblio_invoice&a=' . $action . '&id=' . + (method_exists($post, 'get_id') ? $post->get_id() : $post->ID)); } function _wp_oblio_generate_invoice($order_id, $options = array()) {