#6550 closed enhancement (no action required)
set_current_user deprecated since WP 3.0
Reported by: | modemlooper | Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | minor | Version: | 2.3.2 |
Component: | Core | Keywords: | |
Cc: |
Description
https://codex.wordpress.org/Function_Reference/set_current_user
function is used a handful of times. should it be switched out for
https://codex.wordpress.org/Function_Reference/wp_set_current_user
Change History (5)
#3
@
9 years ago
add_action( 'set_current_user', 'bp_setup_current_user', 10 );
shouldn't that be
add_action( 'wp_set_current_user', 'bp_setup_current_user', 10 );
#4
@
9 years ago
- Keywords 2nd-opinion removed
- Milestone Awaiting Review deleted
- Resolution set to fixed
- Status changed from new to closed
The set_current_user
action fires inside the wp_set_current_user()
function, so even though it's a bit confusing and not ideal code architecture from upstream, BuddyPress's usage here is as required.
Searching the codebase for set_current_user()
usages only brings up BackPress code, so BuddyPress also does not call either function directly; it's just along for the WordPress ride.
Even though this issue was a miss, thanks for keeping an eye out for stuff like this. I find it to be incredibly easy to miss when core deprecates and rearranges things, so it's good to call these out to give them a deeper look.
Where, exactly? Are you getting it confused with the method of the same name in the unit test base class, which does use
wp_set_current_user
?