Skip to content

Commit a9654a2

Browse files
committed
Fix retrieve current post ID
1 parent 5b17716 commit a9654a2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plugin/classes/lib/Redirect.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ public function isRedirect( $id ) {
1919
}
2020

2121
public function checkout() {
22+
global $wp_query;
23+
$post_id = $wp_query->get_queried_object_id();
2224

2325
if ( ! isset( $_GET['order_id'] )
2426
|| ( (string) WC()->session->redirect_order_id !== $_GET['order_id'] )
25-
|| ! $this->isRedirect( get_the_ID() )
27+
|| ! $this->isRedirect( $post_id )
2628
) {
2729
return;
2830
}

0 commit comments

Comments
 (0)