Opened 15 years ago
Closed 15 years ago
#10837 closed enhancement (fixed)
Add *_user_meta() functions
Reported by: | scribu | Owned by: | |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch early |
Focuses: | Cc: |
Description
Since we have a new generic meta API, we should use it on user metadata too.
Also, the old *_usermeta() functions should be deprecated at some point.
Attachments (3)
Change History (24)
#5
@
15 years ago
Can we switch some places in core to use this so we're eating our own dogfood when this goes in?
#9
follow-up:
↓ 11
@
15 years ago
Hi all,
just to let you know,
current code to access usermeta data has the metakey value changed by the following code :
$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);
so meta_key such as 'manage-edit-comments-columns-hidden'
is stored as 'manageeditcommentscolumnshidden'
- i believe this is why usermeta has not been changes in 2.9 .
- patch should still change metakey value for compatibility with existing datas.
#10
follow-up:
↓ 12
@
15 years ago
oh ! and missed this one :
WP Mu has only one usermeta table and a postmeta table per blog ...
so 3.0 still merging WP and WPµ ?
#11
in reply to:
↑ 9
@
15 years ago
Replying to arena:
- patch should still change metakey value for compatibility with existing datas.
No, it shouldn't. That's why we're adding a new set of functions: so that we don't have to worry about compatibility and be consistent with *_post_meta() functions.
#12
in reply to:
↑ 10
@
15 years ago
Replying to arena:
oh ! and missed this one :
WP Mu has only one usermeta table and a postmeta table per blog ...
so 3.0 still merging WP and WPµ ?
I guess we should wait until after most of the merging with MU is done.
#13
@
15 years ago
The patch should still be good. The *_user_meta() functions just wrap around the relative *_metadata() functions. Compat with MS installs should be handled transparently downstream and should not block inclusion of this patch here.
#14
follow-up:
↓ 15
@
15 years ago
There's only about 60 references to the functions these would cause to be deprecated, so we can probably make the switch pretty easily.
Just a note, there is currently no add_usermeta() function, just update_usermeta().
@
15 years ago
Updates patch to 3.0. Also deprecates old *_usermeta functions in exchange for new *_user_meta() functions that use new metadata API.
#15
in reply to:
↑ 14
@
15 years ago
Replying to nacin:
There's only about 60 references to the functions these would cause to be deprecated, so we can probably make the switch pretty easily.
There's really no reason to update those 60 refs right now if using my patch. The old functions are deprecated and turned into wrappers around the new functions for BC reasons.
#18
@
15 years ago
I haven't checked or tested this, nor do I need if we should take action, but from this BP Trac report, it sounds as if [13300] could potentially break backward compatibility:
http://trac.buddypress.org/ticket/2048
#19
@
15 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
The old *_usermeta() functions should be backwards compatible.
I'm working on a patch right now to restore the same hooks and return values. If necessary we can return the original function definitions for *_usermeta(). Getting some second eyes on this could help.
Related: #7540, #10327