Code Duplication    Length = 2-2 lines in 3 locations

wp-includes/class-wp-xmlrpc-server.php 3 locations

@@ 1429-1430 (lines=2) @@
1426
					if ( ! array_key_exists( $taxonomy , $post_type_taxonomies ) )
1427
						return new IXR_Error( 401, __( 'Sorry, one of the given taxonomies is not supported by the post type.' ) );
1428
1429
					if ( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->assign_terms ) )
1430
						return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign a term to one of the given taxonomies.' ) );
1431
1432
					$term_ids = $post_data['terms'][$taxonomy];
1433
					$terms[ $taxonomy ] = array();
@@ 1453-1454 (lines=2) @@
1450
					if ( ! array_key_exists( $taxonomy , $post_type_taxonomies ) )
1451
						return new IXR_Error( 401, __( 'Sorry, one of the given taxonomies is not supported by the post type.' ) );
1452
1453
					if ( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->assign_terms ) )
1454
						return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign a term to one of the given taxonomies.' ) );
1455
1456
					/*
1457
					 * For hierarchical taxonomies, we can't assign a term when multiple terms
@@ 1482-1483 (lines=2) @@
1479
1480
						if ( ! $term ) {
1481
							// Term doesn't exist, so check that the user is allowed to create new terms.
1482
							if ( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->edit_terms ) )
1483
								return new IXR_Error( 401, __( 'Sorry, you are not allowed to add a term to one of the given taxonomies.' ) );
1484
1485
							// Create the new term.
1486
							$term_info = wp_insert_term( $term_name, $taxonomy );