WordPress.org

Make WordPress Core

Ticket #45611: 45611.2.diff

File 45611.2.diff, 1.1 KB (added by dlh, 2 years ago)
  • src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php

    diff --git src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
    index 22a9483550..fe7bd06ee0 100644
    class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { 
    699699                return $params;
    700700        }
    701701
    702         /**
    703          * Validates whether the user can query private statuses.
    704          *
    705          * @since 4.7.0
    706          *
    707          * @param mixed           $value     Status value.
    708          * @param WP_REST_Request $request   Request object.
    709          * @param string          $parameter Additional parameter to pass for validation.
    710          * @return WP_Error|bool True if the user may query, WP_Error if not.
    711          */
    712         public function validate_user_can_query_private_statuses( $value, $request, $parameter ) {
    713                 if ( 'inherit' === $value ) {
    714                         return true;
    715                 }
    716 
    717                 return parent::validate_user_can_query_private_statuses( $value, $request, $parameter );
    718         }
    719 
    720702        /**
    721703         * Handles an upload via multipart/form-data ($_FILES).
    722704         *