Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#28717 closed defect (bug) (invalid)

add_action( 'wp_login', 'my_func', 10, 2) use in multisite prevents login.

Reported by: cleanshooter's profile Cleanshooter Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9.1
Component: Login and Registration Keywords: reporter-feedback
Focuses: multisite Cc:

Description

The use of:

add_action( 'wp_login', 'my_func', 10, 2);

in any plugin does not work in MultiSite anymore.

Non-network admins are re-directed to the login.php and presented with the "Network Admins Only" message.

Network admin are presented with the same page however if an actual network admin refreshes the browser and resends their credentials they are redirected to the admin dashboard for the base site.

Granted I run WPMS on IIS 7.5 so it might be a compatibility issue.

Note:

add_action('wp-login', 'my_func');

does work (if you don't set the [priority] and [accepted_args], afaik).

Change History (5)

#1 @Cleanshooter
11 years ago

correction my testing indicates this does not work for MU plugins... not sure about regular ones.

#2 follow-up: @johnbillion
11 years ago

  • Component changed from Plugins to Login and Registration
  • Keywords reporter-feedback added

Thanks for the report, Cleanshooter.

Can you provide some more details? What does your 'my_func' function do? What is the expected result?

This sounds like an issue with a plugin on your site performing a redirect when you're not expecting it to. You might be better off posting to the support forums.

#3 in reply to: ↑ 2 @Cleanshooter
11 years ago

Replying to johnbillion:

Thanks for the report, Cleanshooter.

Can you provide some more details? What does your 'my_func' function do? What is the expected result?

This sounds like an issue with a plugin on your site performing a redirect when you're not expecting it to. You might be better off posting to the support forums.

Requested Details:

add_action( 'wp_login', array(__CLASS__, 'last_login'),  10, 2);

public function last_login($user_login, $user) {
   //$user_report = self::__get_controller('user_report');
   //$user_report->udpate_last_login($user_login, $user);		
}

As you can see my plugin does nothing right now as I've commented out the action to help test where the problem is. So right now I'm not expecting the action to do anything beyond still let me login.

Since I'm the plugin author and this is the only action that targets 'wp_login' and I've uninstalled all other plugins from my development environment I figure it might be a bug.

#4 @Cleanshooter
11 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Turns out it was bad code in the plugin after all.

My apologies.

#5 @johnbillion
11 years ago

  • Milestone Awaiting Review deleted

No worries!

Note: See TracTickets for help on using tickets.