Make WordPress Core

Changeset 58704

Timestamp:
07/10/2024 11:10:44 AM (4 weeks ago)
Author:
SergeyBiryukov
Message:

Docs: Correct @return values for a few REST API class methods.

Includes listing the expected type first, instead of WP_Error.

Follow-up to [39031], [39033], [46696], [49927], [49929], [50993], [51286], [51973], [52079], [52286], [53152], [56415].

Props antonvlasenko.
See #61593.

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

Legend:

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

    r56093 r58704  
    7979     *
    8080     * @param WP_REST_Request $request Full details about the request.
    81      * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
     81     * @return WP_ Response object on success, or WP_Error object on failure.
    8282     */
    8383    public function get_items( $request ) {
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-edit-site-export-controller.php

    r53402 r58704  
    5151     * @since 5.9.0
    5252     *
    53      * @return WP_Error|true True if the request has access, or WP_Error object.
     53     * @return True if the request has access, or WP_Error object.
    5454     */
    5555    public function permissions_check() {
     
    7171     * @since 5.9.0
    7272     *
    73      * @return WP_Error|void
     73     * @return
    7474     */
    7575    public function export() {
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-menu-locations-controller.php

    r56586 r58704  
    7878     *
    7979     * @param WP_REST_Request $request Full details about the request.
    80      * @return WP_Error|bool True if the request has read access, WP_Error object otherwise.
     80     * @return True if the request has read access, WP_Error object otherwise.
    8181     */
    8282    public function get_items_permissions_check( $request ) {
     
    9898     *
    9999     * @param WP_REST_Request $request Full details about the request.
    100      * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
     100     * @return WP_ Response object on success, or WP_Error object on failure.
    101101     */
    102102    public function get_items( $request ) {
     
    141141     *
    142142     * @param WP_REST_Request $request Full details about the request.
    143      * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
     143     * @return WP_ Response object on success, or WP_Error object on failure.
    144144     */
    145145    public function get_item( $request ) {
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php

    r56586 r58704  
    150150     *
    151151     * @param WP_REST_Request $request Full details about the request.
    152      * @return true|WP_Error True if the request has read access for the item, otherwise false or WP_Error object.
     152     * @return |WP_Error True if the request has read access for the item, otherwise false or WP_Error object.
    153153     */
    154154    public function get_item_permissions_check( $request ) {
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php

    r57648 r58704  
    463463     *
    464464     * @param WP_REST_Request $request Full details about the request.
    465      * @return true|WP_Error True if the request has access to create items, false or WP_Error object otherwise.
     465     * @return .
    466466     */
    467467    public function create_item_permissions_check( $request ) {
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php

    r57312 r58704  
    193193     * @since 5.9.0
    194194     *
    195      * @return WP_Error|bool True if the request has permission, else WP_Error.
     195     * @return True if the request has permission, else WP_Error.
    196196     */
    197197    public function permissions_check() {
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php

    r56559 r58704  
    134134     *
    135135     * @param WP_REST_Request $request Full details about the request.
    136      * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
     136     * @return WP_REST_Response.
    137137     */
    138138    public function get_items( $request ) {
Note: See TracChangeset for help on using the changeset viewer.