Changeset 38698 for trunk/src/wp-includes/class-wp-xmlrpc-server.php
- Timestamp:
- 09/30/2016 10:39:32 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r38620 r38698 1887 1887 $taxonomy = get_taxonomy( $content_struct['taxonomy'] ); 1888 1888 1889 if ( ! current_user_can( $taxonomy->cap-> manage_terms ) )1889 if ( ! current_user_can( $taxonomy->cap->edit_terms ) ) { 1890 1890 return new IXR_Error( 401, __( 'Sorry, you are not allowed to create terms in this taxonomy.' ) ); 1891 } 1891 1892 1892 1893 $taxonomy = (array) $taxonomy; … … 1974 1975 $taxonomy = get_taxonomy( $content_struct['taxonomy'] ); 1975 1976 1976 if ( ! current_user_can( $taxonomy->cap->edit_terms ) )1977 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ) );1978 1979 1977 $taxonomy = (array) $taxonomy; 1980 1978 … … 1989 1987 if ( ! $term ) 1990 1988 return new IXR_Error( 404, __( 'Invalid term ID.' ) ); 1989 1990 if ( ! current_user_can( 'edit_term', $term_id ) ) { 1991 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this term.' ) ); 1992 } 1991 1993 1992 1994 if ( isset( $content_struct['name'] ) ) { … … 2069 2071 2070 2072 $taxonomy = get_taxonomy( $taxonomy ); 2071 2072 if ( ! current_user_can( $taxonomy->cap->delete_terms ) )2073 return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete terms in this taxonomy.' ) );2074 2075 2073 $term = get_term( $term_id, $taxonomy->name ); 2076 2074 … … 2080 2078 if ( ! $term ) 2081 2079 return new IXR_Error( 404, __( 'Invalid term ID.' ) ); 2080 2081 if ( ! current_user_can( 'delete_term', $term_id ) ) { 2082 return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this term.' ) ); 2083 } 2082 2084 2083 2085 $result = wp_delete_term( $term_id, $taxonomy->name ); … … 2141 2143 $taxonomy = get_taxonomy( $taxonomy ); 2142 2144 2143 if ( ! current_user_can( $taxonomy->cap->assign_terms ) )2144 return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ) );2145 2146 2145 $term = get_term( $term_id , $taxonomy->name, ARRAY_A ); 2147 2146 … … 2151 2150 if ( ! $term ) 2152 2151 return new IXR_Error( 404, __( 'Invalid term ID.' ) ); 2152 2153 if ( ! current_user_can( 'assign_term', $term_id ) ) { 2154 return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign this term.' ) ); 2155 } 2153 2156 2154 2157 return $this->_prepare_term( $term );
Note: See TracChangeset
for help on using the changeset viewer.