WordPress.org

Make WordPress Core

Changeset 51286


Ignore:
Timestamp:
06/30/2021 05:58:03 PM (4 months ago)
Author:
SergeyBiryukov
Message:

Docs: List the expected type first instead of WP_Error in some REST API methods added in 5.8.

Follow-up to [46696], [49929], [50995], [51021].

See #52628, #53461.

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

Legend:

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

    r51280 r51286  
    5858     * @param WP_REST_Request $request Full details about the request.
    5959     *
    60      * @return WP_Error|bool True if the request has permission, WP_Error object otherwise.
     60     * @return true|WP_Error True if the request has permission, WP_Error object otherwise.
    6161     */
    6262    public function get_items_permissions_check( $request ) {
     
    8585     * @param WP_REST_Request $request Full details about the request.
    8686     *
    87      * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
     87     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    8888     */
    8989    public function get_items( $request ) {
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php

    r51280 r51286  
    108108     *
    109109     * @param WP_REST_Request $request Full details about the request.
    110      * @return WP_Error|bool True if the request has read access, WP_Error object otherwise.
     110     * @return true|WP_Error True if the request has read access, WP_Error object otherwise.
    111111     */
    112112    public function get_items_permissions_check( $request ) {
     
    120120     *
    121121     * @param WP_REST_Request $request Full details about the request.
    122      * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
     122     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    123123     */
    124124    public function get_items( $request ) {
     
    138138     *
    139139     * @param WP_REST_Request $request Full details about the request.
    140      * @return WP_Error|bool True if the request has read access for the item, WP_Error object otherwise.
     140     * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise.
    141141     */
    142142    public function get_item_permissions_check( $request ) {
     
    159159     * @since 5.8.0
    160160     *
    161      * @return WP_Error|bool True if the widget type is visible, WP_Error otherwise.
     161     * @return true|WP_Error True if the widget type is visible, WP_Error otherwise.
    162162     */
    163163    protected function check_read_permission() {
     
    247247     *
    248248     * @param WP_REST_Request $request Full details about the request.
    249      * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
     249     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    250250     */
    251251    public function get_item( $request ) {
Note: See TracChangeset for help on using the changeset viewer.