|
@@ 59-61 (lines=3) @@
|
| 56 |
|
return new WP_Error( 'unauthorized', 'User cannot edit taxonomy', 403 ); |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
if ( ! isset( $input['parent'] ) || ! is_taxonomy_hierarchical( $taxonomy ) ) { |
| 60 |
|
$input['parent'] = 0; |
| 61 |
|
} |
| 62 |
|
|
| 63 |
|
if ( $term = get_term_by( 'name', $input['name'], $taxonomy ) ) { |
| 64 |
|
// get_term_by is not case-sensitive, but a name with different casing is allowed |
|
@@ 111-113 (lines=3) @@
|
| 108 |
|
} |
| 109 |
|
|
| 110 |
|
$update = array(); |
| 111 |
|
if ( ! empty( $input['parent'] ) || is_taxonomy_hierarchical( $taxonomy ) ) { |
| 112 |
|
$update['parent'] = $input['parent']; |
| 113 |
|
} |
| 114 |
|
|
| 115 |
|
if ( ! empty( $input['description'] ) ) { |
| 116 |
|
$update['description'] = addslashes( $input['description'] ); |