wp/wp-includes/rest-api/fields/class-wp-rest-user-meta-fields.php
changeset 7 cf61fcea0001
child 18 be944660c56a
equal deleted inserted replaced
6:490d5cc509ed 7:cf61fcea0001
       
     1 <?php
       
     2 /**
       
     3  * REST API: WP_REST_User_Meta_Fields class
       
     4  *
       
     5  * @package WordPress
       
     6  * @subpackage REST_API
       
     7  * @since 4.7.0
       
     8  */
       
     9 
       
    10 /**
       
    11  * Core class used to manage meta values for users via the REST API.
       
    12  *
       
    13  * @since 4.7.0
       
    14  *
       
    15  * @see WP_REST_Meta_Fields
       
    16  */
       
    17 class WP_REST_User_Meta_Fields extends WP_REST_Meta_Fields {
       
    18 
       
    19 	/**
       
    20 	 * Retrieves the object meta type.
       
    21 	 *
       
    22 	 * @since 4.7.0
       
    23 	 *
       
    24 	 * @return string The user meta type.
       
    25 	 */
       
    26 	protected function get_meta_type() {
       
    27 		return 'user';
       
    28 	}
       
    29 
       
    30 	/**
       
    31 	 * Retrieves the object meta subtype.
       
    32 	 *
       
    33 	 * @since 4.9.8
       
    34 	 *
       
    35 	 * @return string 'user' There are no subtypes.
       
    36 	 */
       
    37 	protected function get_meta_subtype() {
       
    38 		return 'user';
       
    39 	}
       
    40 
       
    41 	/**
       
    42 	 * Retrieves the type for register_rest_field().
       
    43 	 *
       
    44 	 * @since 4.7.0
       
    45 	 *
       
    46 	 * @return string The user REST field type.
       
    47 	 */
       
    48 	public function get_rest_field_type() {
       
    49 		return 'user';
       
    50 	}
       
    51 }