codepress / admin-columns-issues

Issues for Admin Columns Pro
https://www.admincolumns.com/
11 stars 0 forks source link

new WC_Order bypasses the factory #1272

Closed davidmosterd closed 5 years ago

davidmosterd commented 5 years ago

in ac-addon-woocommerce/classes/Editing/ShopOrder/Status.php:35 we are using new WC_Order, but by doing this we are bypassing the factory and the hook woocommerce_order_class that allows changing the class.

Now, it does no checks so potentially any class could be placed here and deliver a fatal, but I suppose that is not our concern?

If we want to fix this, and I recommend we do, we should replace all new WC_Order instances to use the order factory instead by using wc_get_order