get_usermeta() deprecated in favor of get_user_meta(). But why doesn't it make use of it?

wordpress.stackexchange https://wordpress.stackexchange.com/questions/9026

  •  16-10-2019
  •  | 
  •  

Question

While coding WP I just wondered about this simple fact:

get_usermeta() is deprecated since version 3.0. The warning suggests me to use get_user_meta(). Even the parameters are pretty similar, I wonder why the deprecated function is not making use of the new function as well.

Isn't that a sign that the new function does not really does what the deprecated did?

I'm wondering because I need to replace deprecated calls and wonder a bit.

What makes me even wondering more is the simple fact that get_user_meta() is quite an alias of the 2.9 function get_metadata() with only a constant value'ed parameter 'user' given.

Help ;)

Edit: A counter-example is clean_url() - it's deprecated, the error message shows what this is about and the deprecated function aliases the new one: esc_url(), so it's clear what to do.

Was it helpful?

Solution

Indeed, get_usermeta() behaves differently from get_user_meta() and all the other get_*_meta() functions. That's why it was deprecated.

Unfortunately, the subtle differences couldn't be explained properly in a deprecation notice.

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top