WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 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:

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)

comment:1 SergeyBiryukov2 years ago

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

comment:2 SergeyBiryukov2 years ago

  • Keywords reporter-feedback added

comment:3 kcssm2 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 dd322 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 SergeyBiryukov2 years ago

So, you're looking for admin_init?

comment:6 kcssm2 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 dd322 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 dd322 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 kcssm2 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 SergeyBiryukov2 years ago

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

comment:12 SergeyBiryukov2 years ago

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