Facebook Login not working with WordPress 5.9
-
Hey there,
Facebook Login within WordPress 5.9 gets interrupted by admin-ajax.php giving: Internal Server Error 500 within browser console.
Upon taking a look at PHP errors I get:
Uncaught Error: Call to undefined function wp_get_current_user() in …/wp-includes/capabilities.php:892
That file leads to function is_super_admin() apparently being called too early.
So I searched occurrences of is_super_admin() across my theme and all plugins and found this within CleanTalk 5.171, file “cleantalk.php”…
function apbct_is_user_enable($user) {
// must not call: is_super_admin()
}Complete, working quick fix:
function apbct_is_user_enable($user = null) { global $current_user; $user = $user !== null ? $user : $current_user; # was: return ! (apbct_is_user_role_in(array('administrator', 'editor', 'author'), $user) || is_super_admin() ); return ! (apbct_is_user_role_in(array('administrator', 'editor', 'author'), $user) ); }
Just wanted to put this out here for everyone getting the same issue and provide a quick way to fix.
Next update of CleanTalk should fix this please. However, thank you for this great plugin.
Warm regards
Erik
- The topic ‘Facebook Login not working with WordPress 5.9’ is closed to new replies.