Make WordPress Core

Changeset 51316


Ignore:
Timestamp:
07/02/2021 07:02:13 PM (3 years ago)
Author:
desrosj
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].

Props SergeyBiryukov.
Merges [51286] to the 5.8 branch.
See #52628, #53461.

Location:
branches/5.8
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

  • branches/5.8/src/wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php

    r51311 r51316  
    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 ) {
  • branches/5.8/src/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php

    r51311 r51316  
    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.