Make WordPress Core


Ignore:
Timestamp:
06/30/2021 12:33:43 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Docs: Document the globals used in some REST API methods.

See #53399.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api.php

    r51021 r51278  
    119119 *                                          by object type.
    120120 *
    121  * @param string|array $object_type Object(s) the field is being registered
    122  *                                  to, "post"|"term"|"comment" etc.
     121 * @param string|array $object_type Object(s) the field is being registered to,
     122 *                                  "post"|"term"|"comment" etc.
    123123 * @param string       $attribute   The attribute name.
    124124 * @param array        $args {
     
    136136 */
    137137function register_rest_field( $object_type, $attribute, $args = array() ) {
     138    global $wp_rest_additional_fields;
     139
    138140    $defaults = array(
    139141        'get_callback'    => null,
     
    143145
    144146    $args = wp_parse_args( $args, $defaults );
    145 
    146     global $wp_rest_additional_fields;
    147147
    148148    $object_types = (array) $object_type;
Note: See TracChangeset for help on using the changeset viewer.