Custom wc_add_notice function throws error in wp-admin
-
This function appears to work perfectly when called directly (from my cart page) – it displays a custom notice as-called. However, when trying to log in to wp-admin as an Administrator, with this code present in functions.php (not even being called, just present), I’m hit with an HTTP 500. Only solution has been to totally comment out this function. Any suggestions?
Code:
add_action( 'woocommerce_init', 'sa_custom_notice' ); if (!function_exists('sa_custom_notice')) { function sa_custom_notice( $_msg, $_msgtype ) { global $woocommerce; wc_add_notice( $_msg, $_msgtype ); } }Error in debug.log:
Undefined variable: _msgtype in /var/www/html/wordpress/wp-content/themes/spacious/functions.php on line 724
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Custom wc_add_notice function throws error in wp-admin’ is closed to new replies.