|
@@ 1511-1512 (lines=2) @@
|
| 1508 |
|
if ( ! array_key_exists( $taxonomy , $post_type_taxonomies ) ) |
| 1509 |
|
return new IXR_Error( 401, __( 'Sorry, one of the given taxonomies is not supported by the post type.' ) ); |
| 1510 |
|
|
| 1511 |
|
if ( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->assign_terms ) ) |
| 1512 |
|
return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign a term to one of the given taxonomies.' ) ); |
| 1513 |
|
|
| 1514 |
|
$term_ids = $post_data['terms'][$taxonomy]; |
| 1515 |
|
$terms[ $taxonomy ] = array(); |
|
@@ 1535-1536 (lines=2) @@
|
| 1532 |
|
if ( ! array_key_exists( $taxonomy , $post_type_taxonomies ) ) |
| 1533 |
|
return new IXR_Error( 401, __( 'Sorry, one of the given taxonomies is not supported by the post type.' ) ); |
| 1534 |
|
|
| 1535 |
|
if ( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->assign_terms ) ) |
| 1536 |
|
return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign a term to one of the given taxonomies.' ) ); |
| 1537 |
|
|
| 1538 |
|
/* |
| 1539 |
|
* For hierarchical taxonomies, we can't assign a term when multiple terms |
|
@@ 1564-1565 (lines=2) @@
|
| 1561 |
|
|
| 1562 |
|
if ( ! $term ) { |
| 1563 |
|
// Term doesn't exist, so check that the user is allowed to create new terms. |
| 1564 |
|
if ( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->edit_terms ) ) |
| 1565 |
|
return new IXR_Error( 401, __( 'Sorry, you are not allowed to add a term to one of the given taxonomies.' ) ); |
| 1566 |
|
|
| 1567 |
|
// Create the new term. |
| 1568 |
|
$term_info = wp_insert_term( $term_name, $taxonomy ); |