Make WordPress Core


Ignore:
Timestamp:
10/08/2015 06:00:45 PM (10 years ago)
Author:
SergeyBiryukov
Message:

REST API: Add some missing documentation.

Props swissspidy.
Fixes #34215.

File:
1 edited

Legend:

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

    r34928 r34949  
    55 * @package WordPress
    66 * @subpackage REST_API
     7 * @since 4.4.0
    78 */
    89
     
    1112 *
    1213 * @since 4.4.0
     14 *
     15 * @global WP_REST_Server $wp_rest_server ResponseHandler instance (usually WP_REST_Server).
    1316 *
    1417 * @param string $namespace The first URL segment after core prefix. Should be unique to your package/plugin.
     
    2023 */
    2124function register_rest_route( $namespace, $route, $args = array(), $override = false ) {
    22 
    2325    /** @var WP_REST_Server $wp_rest_server */
    2426    global $wp_rest_server;
     
    6870 *
    6971 * @param string|array $object_type Object(s) the field is being registered
    70  *                                   to, "post"|"term"|"comment" etc.
     72 *                                  to, "post"|"term"|"comment" etc.
    7173 * @param string $attribute         The attribute name.
    7274 * @param array  $args {
     
    7981 *                                              field value. Default is 'null', the value cannot be set or
    8082 *                                              updated.
    81  *     @type string|array|null schema           Optional. The callback function used to create the schema for
     83 *     @type string|array|null $schema          Optional. The callback function used to create the schema for
    8284 *                                              this field. Default is 'null', no schema entry will be returned.
    8385 * }
    8486 */
    8587function register_api_field( $object_type, $attribute, $args = array() ) {
    86 
    8788    $defaults = array(
    8889        'get_callback'    => null,
     
    154155 *
    155156 * @since 4.4.0
     157 *
     158 * @global WP             $wp             Current WordPress environment instance.
     159 * @global WP_REST_Server $wp_rest_server ResponseHandler instance (usually WP_REST_Server).
    156160 */
    157161function rest_api_loaded() {
     
    163167     * Whether this is a REST Request.
    164168     *
     169     * @since 4.4.0
    165170     * @var bool
    166171     */
     
    287292 * @since 4.4.0
    288293 *
    289  * @global WP_REST_Server $wp_rest_server
     294 * @global WP_REST_Server $wp_rest_server ResponseHandler instance (usually WP_REST_Server).
    290295 *
    291296 * @param WP_REST_Request|string $request Request.
     
    448453 */
    449454function rest_send_allow_header( $response, $server, $request ) {
    450 
    451455    $matched_route = $response->get_matched_route();
    452456
Note: See TracChangeset for help on using the changeset viewer.