Hello,I encountered a fatal error related to the multisite_admin_notice function while using the "Thank You Page for WooCommerce" plugin after recent update. The error occurred when accessing the WordPress admin panel. I have multisite network.
[21-Oct-2024 22:39:32 UTC] PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "multisite_admin_notice" not found or invalid function name in /wp-includes/class-wp-hook.php:324
Stack trace:
#0 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#1 /wp-includes/plugin.php(517): WP_Hook->do_action()
#2 /wp-admin/admin-header.php(303): do_action()
#3 /wp-admin/index.php(137): require_once(...)
This error seems to be caused by the multisite_admin_notice function being called without proper context in the before_plugin_load() method. I resolved the issue by modifying the add_action() hook to reference the method within the class using $this, like so:add_action( 'admin_notices', array( $this, 'multisite_admin_notice' ) );
Please look into this issue, as it may affect other users who are running multisite or encountering the same scenario. Let me know if you plan to update the plugin to address this.
I figured out a solution to replace line 122 with following code
add_action( 'admin_notices', array( $this, 'multisite_admin_notice' ) );
Thank you!
Best regards,
Waqar Hassan