WordPress.org

Make WordPress Core

Changeset 47391


Ignore:
Timestamp:
02/28/2020 12:29:53 PM (11 months ago)
Author:
SergeyBiryukov
Message:

Docs: Improve documentation for WP_REST_Attachments_Controller.

This adds a missing DocBlock for ::register_routes() and parameter descriptions for ::post_process_item().

Includes minor documenation fixes in other REST API classes for consistency.

Props dkarfa, mukesh27, SergeyBiryukov.
Fixes #48841.

Location:
trunk/src/wp-includes/rest-api/endpoints
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php

    r47297 r47391  
    1717class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
    1818
     19    /**
     20     * Registers the routes for attachments.
     21     *
     22     * @since 5.3.0
     23     *
     24     * @see register_rest_route()
     25     */
    1926    public function register_routes() {
    2027        parent::register_routes();
     
    345352     * @since 5.3.0
    346353     *
    347      * @param WP_REST_Request $request
    348      * @return WP_REST_Response|WP_Error
     354     * @param WP_REST_Request $request Full details about the request.
     355     * @return WP_REST_Response|WP_Error Response object on success, WP_Error object on failure.
    349356     */
    350357    public function post_process_item( $request ) {
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php

    r47372 r47391  
    7474
    7575    /**
    76      * Registers routes for autosaves.
     76     * Registers the routes for autosaves.
    7777     *
    7878     * @since 5.0.0
     
    152152     * @since 5.0.0
    153153     *
    154      * @param WP_REST_Request $request Full data about the request.
     154     * @param WP_REST_Request $request Full details about the request.
    155155     * @return true|WP_Error True if the request has read access, WP_Error object otherwise.
    156156     */
     
    250250     * @since 5.0.0
    251251     *
    252      * @param WP_REST_Request $request Full data about the request.
     252     * @param WP_REST_Request $request Full details about the request.
    253253     * @return WP_Post|WP_Error Revision post object if ID is valid, WP_Error otherwise.
    254254     */
     
    285285     * @since 5.0.0
    286286     *
    287      * @param WP_REST_Request $request Full data about the request.
     287     * @param WP_REST_Request $request Full details about the request.
    288288     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    289289     */
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-renderer-controller.php

    r47360 r47391  
    3131     *
    3232     * @since 5.0.0
     33     *
     34     * @see register_rest_route()
    3335     */
    3436    public function register_routes() {
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php

    r47233 r47391  
    4141     *
    4242     * @since 4.7.0
     43     *
     44     * @see register_rest_route()
    4345     */
    4446    public function register_routes() {
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php

    r47328 r47391  
    4343     *
    4444     * @since 4.7.0
     45     *
     46     * @see register_rest_route()
    4547     */
    4648    public function register_routes() {
     
    5860     * @since 4.7.0
    5961     *
    60      * @param WP_REST_Request $request Full data about the request.
     62     * @param WP_REST_Request $request Full details about the request.
    6163     * @return true|WP_Error True if the request has read access, WP_Error object otherwise.
    6264     */
     
    7577     * @since 4.7.0
    7678     *
    77      * @param WP_REST_Request $request Full data about the request.
     79     * @param WP_REST_Request $request Full details about the request.
    7880     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    7981     */
     
    9294     * @since 4.7.0
    9395     *
    94      * @param WP_REST_Request $request Full data about the request.
     96     * @param WP_REST_Request $request Full details about the request.
    9597     * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise.
    9698     */
     
    109111     * @since 4.7.0
    110112     *
    111      * @param WP_REST_Request $request Full data about the request.
     113     * @param WP_REST_Request $request Full details about the request.
    112114     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    113115     */
     
    126128     * @since 4.7.0
    127129     *
    128      * @param WP_REST_Request $request Full data about the request.
     130     * @param WP_REST_Request $request Full details about the request.
    129131     * @return true|WP_Error True if the request has access to create items, WP_Error object otherwise.
    130132     */
     
    143145     * @since 4.7.0
    144146     *
    145      * @param WP_REST_Request $request Full data about the request.
     147     * @param WP_REST_Request $request Full details about the request.
    146148     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    147149     */
     
    160162     * @since 4.7.0
    161163     *
    162      * @param WP_REST_Request $request Full data about the request.
     164     * @param WP_REST_Request $request Full details about the request.
    163165     * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise.
    164166     */
     
    177179     * @since 4.7.0
    178180     *
    179      * @param WP_REST_Request $request Full data about the request.
     181     * @param WP_REST_Request $request Full details about the request.
    180182     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    181183     */
     
    194196     * @since 4.7.0
    195197     *
    196      * @param WP_REST_Request $request Full data about the request.
     198     * @param WP_REST_Request $request Full details about the request.
    197199     * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise.
    198200     */
     
    211213     * @since 4.7.0
    212214     *
    213      * @param WP_REST_Request $request Full data about the request.
     215     * @param WP_REST_Request $request Full details about the request.
    214216     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    215217     */
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php

    r47233 r47391  
    6262
    6363    /**
    64      * Registers routes for revisions based on post types supporting revisions.
     64     * Registers the routes for revisions based on post types supporting revisions.
    6565     *
    6666     * @since 4.7.0
     
    161161     * @since 4.7.0
    162162     *
    163      * @param WP_REST_Request $request Full data about the request.
     163     * @param WP_REST_Request $request Full details about the request.
    164164     * @return true|WP_Error True if the request has read access, WP_Error object otherwise.
    165165     */
     
    215215     * @since 4.7.0
    216216     *
    217      * @param WP_REST_Request $request Full data about the request.
     217     * @param WP_REST_Request $request Full details about the request.
    218218     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    219219     */
     
    364364     * @since 4.7.0
    365365     *
    366      * @param WP_REST_Request $request Full data about the request.
     366     * @param WP_REST_Request $request Full details about the request.
    367367     * @return bool|WP_Error True if the request has read access for the item, WP_Error object otherwise.
    368368     */
     
    376376     * @since 4.7.0
    377377     *
    378      * @param WP_REST_Request $request Full data about the request.
     378     * @param WP_REST_Request $request Full details about the request.
    379379     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    380380     */
Note: See TracChangeset for help on using the changeset viewer.