WordPress.org

Make WordPress Core

Opened 4 months ago

Last modified 4 months ago

#43339 assigned enhancement

Global user_options calls should use user_meta instead

Reported by: johnjamesjacoby Owned by: zkancs
Milestone: 5.0 Priority: normal
Severity: normal Version:
Component: General Keywords: 2nd-opinion good-first-bug has-patch
Focuses: Cc:

Description

There are 2 places where WordPress uses the user_option functions with the global flag set to true which internally invokes the user_meta functions.

In these cases, there is no benefit to using user_option and only a detriment by way of additional function calls.

The user-meta keys in question are:

  • default_password_nag
  • community-events-location

Attachments (4)

43339.diff (4.8 KB) - added by zkancs 4 months ago.
Use update_user_meta instead of update_user_option
43339.2.diff (4.8 KB) - added by zkancs 4 months ago.
43339.3.diff (10.4 KB) - added by zkancs 4 months ago.
43339.4.diff (8.2 KB) - added by zkancs 4 months ago.

Download all attachments as: .zip

Change History (10)

#1 @obenland
4 months ago

  • Owner set to zkancs
  • Status changed from new to assigned

@zkancs
4 months ago

Use update_user_meta instead of update_user_option

@zkancs
4 months ago

#2 @obenland
4 months ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Awaiting Review to 5.0

#3 @obenland
4 months ago

It looks like there are some more instances where update_user_option is used with $global set to true. Doe we want to change those too?

#4 @zkancs
4 months ago

@obenland Yes, I'll change the rest of them.

@zkancs
4 months ago

#5 @zkancs
4 months ago

There're some mistakes in the HTML I've made. Fixing them.

@zkancs
4 months ago

#6 @zkancs
4 months ago

@obenland Fixed. I think I've changed every place where update_user_option is used with $global set to true. Please review again.

Note: See TracTickets for help on using tickets.