Should this be used in conjunction with Multisite Emails and Redirects?
-
Hello and thank you for time and work.
We are testing the plugin on a multisite together with your other scripts “Multisite Emails and Redirects” found at: https://halfelf.org/2016/multisite-redirect-registrtation-per-site/
For some reason we get an PHP notice on the login screen:
PHP Notice: Undefined property: WP_Error::$ID in /wp-content/mu-plugins/multisite-registration.php on line 99
Line 99 corresponds to the second line of the code “Redirect Logins to Their Site”:add_filter('login_redirect', function ( $redirect_to, $request_redirect_to, $user ) { if ($user->ID != 0) { $user_info = get_userdata($user->ID); if ($user_info->primary_blog) { $primary_url = get_blogaddress_by_id($user_info->primary_blog) . 'wp-admin/'; if ($primary_url) { wp_redirect($primary_url); die(); } } } return $redirect_to; }, 100, 3);
I understand it is only a notice, but it shows right up on the login screen and looks really bad.
Could you please help?
thank you in advance
marikamitsos
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Should this be used in conjunction with Multisite Emails and Redirects?’ is closed to new replies.