WordPress.org

Make WordPress Core

Opened 18 months ago

Last modified 8 months ago

#43339 assigned enhancement

Global user_options calls should use user_meta instead

Reported by: johnjamesjacoby Owned by: zkancs
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: General Keywords: 2nd-opinion good-first-bug has-patch needs-refresh
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 18 months ago.
Use update_user_meta instead of update_user_option
43339.2.diff (4.8 KB) - added by zkancs 18 months ago.
43339.3.diff (10.4 KB) - added by zkancs 18 months ago.
43339.4.diff (8.2 KB) - added by zkancs 18 months ago.

Download all attachments as: .zip

Change History (12)

#1 @obenland
18 months ago

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

@zkancs
18 months ago

Use update_user_meta instead of update_user_option

@zkancs
18 months ago

#2 @obenland
18 months ago

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

#3 @obenland
18 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
18 months ago

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

@zkancs
18 months ago

#5 @zkancs
18 months ago

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

@zkancs
18 months ago

#6 @zkancs
18 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.

#7 @johnbillion
11 months ago

  • Milestone changed from 5.0 to 5.1

#8 @pento
8 months ago

  • Keywords needs-refresh added
  • Milestone changed from 5.1 to Future Release

43339.4.diff needs updating to apply to trunk.

Note: See TracTickets for help on using tickets.