Menu Page in admin not working after update to 4.8
-
Hello,
After updating to the latest version of wordpress I noticed that the page in Admin -> Appearence -> Menu is not working. I managed to narrow down the cause of the problem to a custom function
function my_custom_available_payment_gateways( $gateways ) { $chosen_shipping_rates = WC()->session->get( 'chosen_shipping_methods' ); if ( ! in_array( 'local_pickup_plus', $chosen_shipping_rates ) ) : unset( $gateways['cheque'] ); endif; if ( in_array( 'local_pickup_plus', $chosen_shipping_rates ) ) : unset( $gateways['cod'] ); endif; return $gateways; } add_filter( 'woocommerce_available_payment_gateways', 'my_custom_available_payment_gateways' );
This function filters payment gateways depending on shipping method. If I remove this function Menu page in admin returns to normal. If I add the function again menu page does not work and server logs the following errors
#0: *2967264 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error: Call to a member function get() on null in /child-theme-path/functions.php:66 Stack trace: #0 /path/wp-includes/class-wp-hook.php(298): my_custom_available_payment_gateways(Array) #1 /path/wp-includes/plugin.php(203): WP_Hook->apply_filters(Array, Array) #2 /path/wp-content/plugins/woocommerce/includes/class-wc-payment-gateways.php(165): apply_filters(‘woocommerce_ava…’, Array) #3 /path/wp-content/plugins/woocommerce/includes/wc-account-functions.php(115): WC_Payment_Gateways->get_available_payment_gateways() #4 /path/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-menus.php(242): wc_get_account_menu_items() #5 /path/wp-admin/includes/template.php(1170): WC_Admin_Menus->nav_menu_links(NULL, Array) #6 /var” while reading response header from upstream
I had no problems with previous wordpress versions. Any ideas?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Menu Page in admin not working after update to 4.8’ is closed to new replies.