Make WordPress Core


Ignore:
Timestamp:
11/11/2019 02:41:15 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Docs: In various @return tags, list the expected type first, instead of WP_Error.

See #48303.

File:
1 edited

Legend:

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

    r46586 r46696  
    5555     *
    5656     * @param WP_REST_Request $request Full data about the request.
    57      * @return WP_Error|bool True if the request has read access, WP_Error object otherwise.
     57     * @return true|WP_Error True if the request has read access, WP_Error object otherwise.
    5858     */
    5959    public function get_items_permissions_check( $request ) {
     
    6868     *
    6969     * @param WP_REST_Request $request Full data about the request.
    70      * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
     70     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    7171     */
    7272    public function get_items( $request ) {
     
    8181     *
    8282     * @param WP_REST_Request $request Full data about the request.
    83      * @return WP_Error|bool True if the request has read access for the item, WP_Error object otherwise.
     83     * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise.
    8484     */
    8585    public function get_item_permissions_check( $request ) {
     
    9494     *
    9595     * @param WP_REST_Request $request Full data about the request.
    96      * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
     96     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    9797     */
    9898    public function get_item( $request ) {
     
    107107     *
    108108     * @param WP_REST_Request $request Full data about the request.
    109      * @return WP_Error|bool True if the request has access to create items, WP_Error object otherwise.
     109     * @return true|WP_Error True if the request has access to create items, WP_Error object otherwise.
    110110     */
    111111    public function create_item_permissions_check( $request ) {
     
    120120     *
    121121     * @param WP_REST_Request $request Full data 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 create_item( $request ) {
     
    133133     *
    134134     * @param WP_REST_Request $request Full data about the request.
    135      * @return WP_Error|bool True if the request has access to update the item, WP_Error object otherwise.
     135     * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise.
    136136     */
    137137    public function update_item_permissions_check( $request ) {
     
    146146     *
    147147     * @param WP_REST_Request $request Full data about the request.
    148      * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
     148     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    149149     */
    150150    public function update_item( $request ) {
     
    159159     *
    160160     * @param WP_REST_Request $request Full data about the request.
    161      * @return WP_Error|bool True if the request has access to delete the item, WP_Error object otherwise.
     161     * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise.
    162162     */
    163163    public function delete_item_permissions_check( $request ) {
     
    172172     *
    173173     * @param WP_REST_Request $request Full data about the request.
    174      * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
     174     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    175175     */
    176176    public function delete_item( $request ) {
     
    185185     *
    186186     * @param WP_REST_Request $request Request object.
    187      * @return WP_Error|object The prepared item, or WP_Error object on failure.
     187     * @return object|WP_Error The prepared item, or WP_Error object on failure.
    188188     */
    189189    protected function prepare_item_for_database( $request ) {
     
    199199     * @param mixed           $item    WordPress representation of the item.
    200200     * @param WP_REST_Request $request Request object.
    201      * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
     201     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    202202     */
    203203    public function prepare_item_for_response( $item, $request ) {
Note: See TracChangeset for help on using the changeset viewer.