#19215 closed defect (bug) (invalid)

'init' action hook loading in wp-login.php page before logging into wordpress

Reported by: kcssm Owned by:
Priority: normal Milestone:
Component: General Version: 3.3
Severity: major Keywords:
Cc:

Description

add_action( 'init', 'my_function' ); loads before logging into the wordpress in the log-in page itself. So what this does is, loads all the enqueued scripts defined in the fucntion on the login page itself, which should have loaded only after the wordpress has finished loading.

Change History (12)

Not sure I understand the problem. Are you looking for admin_enqueue_scripts, perhaps?

  • Keywords reporter-feedback added
  • Keywords reporter-feedback removed

add_action( 'init', 'my_fucntion' ); Any scripts enqueued in my_function loads in the wp-login.php page before logging into the wordpress.

You're confusing some terms here by the sound of it. You don't mean Enqueued scripts, you mean hooked functions.

So, you're looking for admin_init?

'init' action hook used to load only after the wordpress has finished log-in. But now it loads before log-in in the wp-login.php page itself.

'init' action hook used to load only after the wordpress has finished log-in.

What version of WordPress did you see that in?

http://codex.wordpress.org/Plugin_API/Action_Reference/init here it says so.

Loading != Login

AFAIK, The Login process has always happened after WordPress has been setup, therefor, after the init action is fired.

It was working fine untill I updated to wordpress 3.3, so i thought may be this was a bug or something. So I guess, it was my bad, sorry about this, but I am still wondering why it was working in previous versions perfectly fine.

anyways thanks to all of you.

First thing wp-login.php does is load other WordPress files:
http://core.trac.wordpress.org/browser/trunk/wp-login.php#L11

This is when init is fired:
http://core.trac.wordpress.org/browser/trunk/wp-settings.php#L304

This behaviour doesn't seem to have changed since 1.5:
http://core.trac.wordpress.org/browser/tags/1.5/wp-login.php#L2

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.