Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#19215 closed defect (bug) (invalid)

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

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


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)

comment:1 @SergeyBiryukov4 years ago

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

comment:2 @SergeyBiryukov4 years ago

  • Keywords reporter-feedback added

comment:3 @kcssm4 years ago

  • 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.

comment:4 @dd324 years ago

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

comment:5 @SergeyBiryukov4 years ago

So, you're looking for admin_init?

comment:6 @kcssm4 years ago

'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.

comment:7 @dd324 years ago

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

What version of WordPress did you see that in?

comment:9 @dd324 years ago

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.

comment:10 @kcssm4 years ago

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.

comment:11 @SergeyBiryukov4 years ago

First thing wp-login.php does is load other WordPress files:

This is when init is fired:

This behaviour doesn't seem to have changed since 1.5:

comment:12 @SergeyBiryukov4 years ago

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