Make WordPress Core


Ignore:
Timestamp:
07/06/2021 03:41:35 PM (5 years ago)
Author:
desrosj
Message:

REST API: Add the $request parameter to methods checking permissions.

This adds the $request parameter to the permissions_check() methods within WP_REST_Widgets_Controller and adds $request as an allowed parameter to the permissions_check() method within WP_REST_Templates_Controller.

Even when this parameter is not used by default, it should be implemented to support the class being extended and the method overidden.

Props johnbillion, timothyblynjacobs.
Fixes #53593.

File:
1 edited

Legend:

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

    r51298 r51349  
    110110         * @since 5.8.0
    111111         *
     112         * @param WP_REST_Request $request Full details about the request.
    112113         * @return true|WP_Error True if the request has read access, WP_Error object otherwise.
    113114         */
    114         protected function permissions_check() {
     115        protected function permissions_check( $request ) {
    115116                // Verify if the current user has edit_theme_options capability.
    116117                // This capability is required to edit/view/delete templates.
Note: See TracChangeset for help on using the changeset viewer.