diff --git a/includes/class-wc-form-handler.php b/includes/class-wc-form-handler.php index 99a52d32907..ccaff73b7b0 100644 --- a/includes/class-wc-form-handler.php +++ b/includes/class-wc-form-handler.php @@ -391,7 +391,7 @@ class WC_Form_Handler { public function order_again() { // Nothing to do - if ( ! isset( $_GET['order_again'] ) || ! is_user_logged_in() || ! WC()->verify_nonce( 'order_again', '_GET' ) || ! wp_verify_nonce( $_GET['_wpnonce'], 'woocommerce-order_again' ) ) + if ( ! isset( $_GET['order_again'] ) || ! is_user_logged_in() || ! wp_verify_nonce( $_GET['_wpnonce'], 'woocommerce-order_again' ) ) return; // Clear current cart diff --git a/includes/wc-conditional-functions.php b/includes/wc-conditional-functions.php index e1bc5dfc2b4..10387809c77 100644 --- a/includes/wc-conditional-functions.php +++ b/includes/wc-conditional-functions.php @@ -231,6 +231,11 @@ if ( ! function_exists( 'meta_is_product_attribute' ) ) { */ function meta_is_product_attribute( $name, $value, $product_id ) { $product = get_product( $product_id ); + + if ( $product->product_type != 'variation' ) { + return false; + } + $attributes = $product->get_variation_attributes(); var_dump($attributes[ $name ]); diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index fc344bba20b..fd77ce05f8a 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -1496,7 +1496,7 @@ if ( ! function_exists( 'woocommerce_order_again_button' ) ) { ?>
verify_nonce', '2.1', 'WC_Nonce_Helper->verify_nonce' ); + _deprecated_function( 'Woocommerce->verify_nonce', '2.1', 'wp_verify_nonce' ); return wp_verify_nonce( $$method[ '_wpnonce' ], 'woocommerce-' . $action ); }