We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f26746a commit d734ac4Copy full SHA for d734ac4
src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
@@ -198,6 +198,20 @@ public function get_items_permissions_check( $request ) {
198
}
199
200
if ( ! current_user_can( 'edit_posts' ) ) {
201
+ foreach ( $protected_params as $param ) {
202
+ if ( 'status' === $param ) {
203
+ if ( 'approve' !== $request[ $param ] ) {
204
+ $forbidden_params[] = $param;
205
+ }
206
+ } elseif ( 'type' === $param ) {
207
+ if ( 'comment' !== $request[ $param ] ) {
208
209
210
+ } elseif ( ! empty( $request[ $param ] ) ) {
211
212
213
214
+
215
if ( ! empty( $forbidden_params ) ) {
216
return new WP_Error(
217
'rest_forbidden_param',
0 commit comments