Make WordPress Core

Ticket #38808: 38808-assign-terms.patch

File 38808-assign-terms.patch, 1.8 KB (added by ramiy, 7 years ago)
  • wp-includes/class-wp-xmlrpc-server.php

     
    21422142                        return new IXR_Error( 404, __( 'Invalid term ID.' ) );
    21432143
    21442144                if ( ! current_user_can( 'assign_term', $term_id ) ) {
    2145                         return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign this term.' ) );
     2145                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign terms.' ) );
    21462146                }
    21472147
    21482148                return $this->_prepare_term( $term );
  • wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

     
    462462                }
    463463
    464464                if ( ! $this->check_assign_terms_permission( $request ) ) {
    465                         return new WP_Error( 'rest_cannot_assign_term', __( 'Sorry, you are not allowed to assign the provided terms.' ), array( 'status' => rest_authorization_required_code() ) );
     465                        return new WP_Error( 'rest_cannot_assign_term', __( 'Sorry, you are not allowed to assign terms.' ), array( 'status' => rest_authorization_required_code() ) );
    466466                }
    467467
    468468                return true;
     
    599599                }
    600600
    601601                if ( ! $this->check_assign_terms_permission( $request ) ) {
    602                         return new WP_Error( 'rest_cannot_assign_term', __( 'Sorry, you are not allowed to assign the provided terms.' ), array( 'status' => rest_authorization_required_code() ) );
     602                        return new WP_Error( 'rest_cannot_assign_term', __( 'Sorry, you are not allowed to assign terms.' ), array( 'status' => rest_authorization_required_code() ) );
    603603                }
    604604
    605605                return true;