A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.
Go to file
Patricia Hillebrandt 61fbf572cb Single Product Block > Only reset the post data if `setup_postdata` was invoked. (https://github.com/woocommerce/woocommerce-blocks/pull/9474)
* Only call wp_reset_postdata() if the global post variable was changed.

* Make global_post_variable_changed static.

* rely on the output of setup_postdata for verifying if the global variable was successfully changed.

* ditch the static var and defaulting to false instead.

* Rely on static as the post reset only happens when the loop of inner blocks ends and not right away.

* Update the  variable when the postdata is reset.
2023-05-18 15:35:46 +02:00
plugins/woocommerce-blocks Single Product Block > Only reset the post data if `setup_postdata` was invoked. (https://github.com/woocommerce/woocommerce-blocks/pull/9474) 2023-05-18 15:35:46 +02:00