johnbillion / user-switching

WordPress plugin that provides instant switching between user accounts.
https://wordpress.org/plugins/user-switching/
GNU General Public License v2.0
187 stars 49 forks source link

Error filter_woocommerce_account_menu_items expect array #98

Closed hrangel1126 closed 1 year ago

hrangel1126 commented 1 year ago

Error found in Wordpress 6.1.1 and woocomerce 7.0 Error filter_woocommerce_account_menu_items expect array

fixed in user-switching.php line 1058 add to functio to accept NULL by chaign the fcuntion as below

From public function filter_woocommerce_account_menu_items( array $items ) To public function filter_woocommerce_account_menu_items( array $items = NULL )

johnbillion commented 1 year ago

Thanks for the report. WooCommerce passes an array to the woocommerce_account_menu_items filter so there must be a plugin on your site that is incorrectly returning null from this filter. Try deactivating your other plugins one by one to see if you can find the culprit.