PHP Fatal Error – Uncaught Error: Call to Undefined Function switch_to_blog()
-
I am encountering a PHP fatal error with the following message:
The error occurs when trying to access the WordPress admin area, and the stack trace suggests that the issue arises from theOmnisend Connectplugin, specifically in theclass-omnisend-helper.phpfile.PHP Fatal error: Uncaught Error: Call to undefined function switch_to_blog() in /wp-content/plugins/omnisend-connect/manager/class-omnisend-helper.php:280#0 /wp-content/plugins/omnisend-connect/manager/class-omnisend-helper.php(201): Omnisend_Helper::check_user_role_for_oauth_access()
#1 /wp-content/plugins/omnisend-connect/omnisend-woocommerce.php(307): Omnisend_Helper::is_woocommerce_api_access_granted()
#2 /wp-includes/class-wp-hook.php(324): omnisend_show_api_access_notice()
#3 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#4 /wp-includes/plugin.php(517): WP_Hook->do_action()
#5 /wp-admin/admin-header.php(313): do_action()
#6 /wp-admin/index.php(137): require_once('/wp-admin/admin-header.php')
#7 {main}The error is caused by the
switch_to_blog()function being called in the plugin, which is typically used in multisite installations. However, my WordPress setup is not a multisite network, so the function is not available, leading to the fatal error.
The topic ‘PHP Fatal Error – Uncaught Error: Call to Undefined Function switch_to_blog()’ is closed to new replies.