wp/wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
    25 		$this->namespace = 'wp/v2';
    25 		$this->namespace = 'wp/v2';
    26 		$this->rest_base = 'statuses';
    26 		$this->rest_base = 'statuses';
    27 	}
    27 	}
    28 
    28 
    29 	/**
    29 	/**
    30 	 * Registers the routes for the objects of the controller.
    30 	 * Registers the routes for post statuses.
    31 	 *
    31 	 *
    32 	 * @since 4.7.0
    32 	 * @since 4.7.0
    33 	 *
    33 	 *
    34 	 * @see register_rest_route()
    34 	 * @see register_rest_route()
    35 	 */
    35 	 */
   266 		} else {
   266 		} else {
   267 			$response->add_link( 'archives', add_query_arg( 'status', $status->name, rest_url( 'wp/v2/posts' ) ) );
   267 			$response->add_link( 'archives', add_query_arg( 'status', $status->name, rest_url( 'wp/v2/posts' ) ) );
   268 		}
   268 		}
   269 
   269 
   270 		/**
   270 		/**
   271 		 * Filters a status returned from the REST API.
   271 		 * Filters a post status returned from the REST API.
   272 		 *
   272 		 *
   273 		 * Allows modification of the status data right before it is returned.
   273 		 * Allows modification of the status data right before it is returned.
   274 		 *
   274 		 *
   275 		 * @since 4.7.0
   275 		 * @since 4.7.0
   276 		 *
   276 		 *
   277 		 * @param WP_REST_Response $response The response object.
   277 		 * @param WP_REST_Response $response The response object.
   278 		 * @param object           $status   The original status object.
   278 		 * @param object           $status   The original post status object.
   279 		 * @param WP_REST_Request  $request  Request used to generate the response.
   279 		 * @param WP_REST_Request  $request  Request used to generate the response.
   280 		 */
   280 		 */
   281 		return apply_filters( 'rest_prepare_status', $response, $status, $request );
   281 		return apply_filters( 'rest_prepare_status', $response, $status, $request );
   282 	}
   282 	}
   283 
   283