WC 2.2.10 – Broken Filter: woocommerce_reports_order_statuses
-
We’ve had custom order statuses and a filter on woocommerce_reports_order_statuses to include them in reporting. It has worked fine for a while. As of (at least) 2.2.10 and WP 4.1 this filter is now broken.
The reports page displays the following:
Warning: array_push() expects parameter 1 to be array, boolean given in D:\www\ns-plugins\wp-content\plugins\ns-fba-for-woocommerce\ns-fba-for-woocommerce.php on line 321
Line 321 of our plugin is inside our hooked filter function. Relevant code:
// add custom order statuses to normal reporting for woocommerce add_filter( 'woocommerce_reports_order_statuses', array( $this, 'add_custom_status_reporting' ) ); ... /** * Register custom statuses with WooCommerce Reporting * see line 67 /wp-content/plugins/woocommerce/includes/admin/reports/class-wc-admin-report.php */ function add_custom_status_reporting( $statuses ) { array_push( $statuses, 'sent-to-fba'); array_push( $statuses, 'fail-to-fba'); return $statuses; }
Did something break with the woocommerce_reports_order_statuses filter in a recent version? This is a pretty simple scenario. Why would the woocommerce_reports_order_statuses be sending a boolean into the hooked filter function?
Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘WC 2.2.10 – Broken Filter: woocommerce_reports_order_statuses’ is closed to new replies.