[wp-trac] [WordPress Trac] #32234: Streamline parameter order of get_user_option()
WordPress Trac
noreply at wordpress.org
Sat May 2 09:23:53 UTC 2015
#32234: Streamline parameter order of get_user_option()
-------------------------+-----------------------------
Reporter: mechter | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 4.2.1
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
`get_user_meta()` expects `$user_id`, followed by `$meta_key`. So do
`update_user_meta()`, `delete_user_meta()`, `update_user_option()` and
`delete_user_option()`.
`get_user_option()` sticks out in that it expects these parameters in
reversed order, which just caused me some major frustration even though I
had looked it up before.
To enable backwards compability, we could test which of the two parameters
is an integer and then swap them if necessary (unless of course meta keys
can be integers too, I have not checked that, but it seems unlikely).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/32234>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list