WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/22/2010 06:35:35 PM (12 years ago)
Author:
nacin
Message:

Introduce *_user_meta() functions, deprecate *_usermeta() family. Fixes #10837 props scribu, technosailor.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/deprecated.php

    r13299 r13300  
    22672267}
    22682268
    2269 ?>
     2269/**
     2270 * Remove user meta data.
     2271 *
     2272 * @since 2.0.0
     2273 * @deprecated 3.0.0
     2274 * @deprecated Use delete_user_meta()
     2275 * @see delete_user_meta()
     2276 *
     2277 * @param int $user_id User ID.
     2278 * @param string $meta_key Metadata key.
     2279 * @param mixed $meta_value Metadata value.
     2280 * @return bool True deletion completed and false if user_id is not a number.
     2281 */
     2282function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) {
     2283    _deprecated_function( __FUNCTION__, '3.0', 'delete_user_meta()' );
     2284    return delete_user_meta( $user_id, $meta_key, $meta_value );
     2285}
     2286
     2287/**
     2288 * Retrieve user metadata.
     2289 *
     2290 * If $user_id is not a number, then the function will fail over with a 'false'
     2291 * boolean return value. Other returned values depend on whether there is only
     2292 * one item to be returned, which be that single item type. If there is more
     2293 * than one metadata value, then it will be list of metadata values.
     2294 *
     2295 * @since 2.0.0
     2296 * @deprecated 3.0.0
     2297 * @deprecated Use get_user_meta()
     2298 * @see get_user_meta()
     2299 *
     2300 * @param int $user_id User ID
     2301 * @param string $meta_key Optional. Metadata key.
     2302 * @return mixed
     2303 */
     2304function get_usermeta( $user_id, $meta_key = '') {
     2305    _deprecated_function( __FUNCTION__, '3.0', 'get_user_meta()' );
     2306    return get_user_meta( $user_id, $meta_key, false );
     2307}
     2308
     2309/**
     2310 * Update metadata of user.
     2311 *
     2312 * There is no need to serialize values, they will be serialized if it is
     2313 * needed. The metadata key can only be a string with underscores. All else will
     2314 * be removed.
     2315 *
     2316 * Will remove the metadata, if the meta value is empty.
     2317 *
     2318 * @since 2.0.0
     2319 * @deprecated 3.0.0
     2320 * @deprecated Use update_user_meta()
     2321 * @see update_user_meta()
     2322 *
     2323 * @param int $user_id User ID
     2324 * @param string $meta_key Metadata key.
     2325 * @param mixed $meta_value Metadata value.
     2326 * @return bool True on successful update, false on failure.
     2327 */
     2328function update_usermeta( $user_id, $meta_key, $meta_value ) {
     2329    _deprecated_function( __FUNCTION__, '3.0', 'update_user_meta()' );
     2330    return update_user_meta( $user_id, $meta_key, $meta_value );
     2331}
Note: See TracChangeset for help on using the changeset viewer.