Ticket #10938 (closed defect (bug): fixed)
AtomPub redefines pluggable wp_set_current_user()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.9 |
| Component: | AtomPub | Version: | 2.8.4 |
| Severity: | normal | Keywords: | dev-feedback |
| Cc: |
Description
wp-app.php redefines the pluggable wp_set_current_user().
This means that plugins which redefine wp_set_current_user() don't work during a APP call.
Also the redefined function is identical to the core function except that it calls neither setup_userdata() nor do_action( 'set_current_user' ).
setup_userdata() defines some globals that plugins might rely on. And defining globals is basically all it does, so it's not very expensive.
The do_action( 'set_current_user' ) is important for plugins that need to sync user data, change caps, etc.
I have no insight into why wp-app.php needs to redefine the function.
Change History
- Owner changed from josephscott to westi
- Status changed from new to accepted
I think these can go as well:
/** Post Template API */ require_once(ABSPATH . WPINC . '/post-template.php'); /** Feed Handling API */ require_once(ABSPATH . WPINC . '/feed.php');
As they will also already be included.
Replying to westi:
I think it can just be ripped out.
As it never gets used.
wp-app.php pulls in wp-load.php at the top and by the time the function_exist check is reached the function is already defined.
Ha. Good point :)

I think it can just be ripped out.
As it never gets used.
wp-app.php pulls in wp-load.php at the top and by the time the function_exist check is reached the function is already defined.