Make WordPress Core


Ignore:
Timestamp:
11/09/2016 03:41:07 AM (10 years ago)
Author:
rmccue
Message:

Roles/Capabilities: Add meta-caps for comment, term, and user meta.

Additionally, use these meta-caps in the REST API endpoints.

Previously, register_meta()'s auth_callback had no effect for non-post meta. This introduces {add,edit,delete}_{comment,term,user}_meta meta-caps to match the existing post meta capabilities. These are currently only used in the REST API.

Props tharsheblows, boonebgorges.
Fixes #38303, fixes #38412.

File:
1 edited

Legend:

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

    r39161 r39179  
    632632                                return new WP_Error( 'rest_comment_failed_edit', __( 'Updating comment status failed.' ), array( 'status' => 500 ) );
    633633                        }
    634                 } else {
     634                } elseif ( ! empty( $prepared_args ) ) {
    635635                        if ( is_wp_error( $prepared_args ) ) {
    636636                                return $prepared_args;
Note: See TracChangeset for help on using the changeset viewer.