json-endpoints/class.wpcom-json-api-update-taxonomy-endpoint.php 1 location
|
@@ 37-39 (lines=3) @@
|
| 34 |
|
} |
| 35 |
|
|
| 36 |
|
$user = wp_get_current_user(); |
| 37 |
|
if ( !$user || is_wp_error( $user ) || !$user->ID ) { |
| 38 |
|
return new WP_Error( 'authorization_required', 'An active access token must be used to manage taxonomies.', 403 ); |
| 39 |
|
} |
| 40 |
|
|
| 41 |
|
$tax = get_taxonomy( $taxonomy_type ); |
| 42 |
|
if ( !current_user_can( $tax->cap->edit_terms ) ) { |
json-endpoints/class.wpcom-json-api-update-term-endpoint.php 1 location
|
@@ 24-26 (lines=3) @@
|
| 21 |
|
} |
| 22 |
|
|
| 23 |
|
$user = wp_get_current_user(); |
| 24 |
|
if ( ! $user || is_wp_error( $user ) || ! $user->ID ) { |
| 25 |
|
return new WP_Error( 'authorization_required', 'An active access token must be used to manage taxonomies.', 403 ); |
| 26 |
|
} |
| 27 |
|
|
| 28 |
|
$taxonomy_meta = get_taxonomy( $taxonomy ); |
| 29 |
|
if ( false === $taxonomy_meta || ( |