Code Duplication    Length = 13-13 lines in 2 locations

classes/fields/pick.php 2 locations

@@ 851-863 (lines=13) @@
848
849
		// Set the file name and args based on the content type of the relationship
850
		switch ( $args->options['pick_object'] ) {
851
			case 'post_type':
852
				if ( ! empty( $args->options['pick_val'] ) ) {
853
					$post_type_obj = get_post_type_object( $args->options['pick_val'] );
854
855
					if ( $post_type_obj && current_user_can( $post_type_obj->cap->create_posts ) ) {
856
						$file_name  = 'post-new.php';
857
						$query_args = array(
858
							'post_type' => $args->options['pick_val'],
859
						);
860
					}
861
				}
862
863
				break;
864
865
			case 'taxonomy':
866
				if ( ! empty( $args->options['pick_val'] ) ) {
@@ 865-877 (lines=13) @@
862
863
				break;
864
865
			case 'taxonomy':
866
				if ( ! empty( $args->options['pick_val'] ) ) {
867
					$taxonomy_obj = get_taxonomy( $args->options['pick_val'] );
868
869
					if ( $taxonomy_obj && current_user_can( $taxonomy_obj->cap->edit_terms ) ) {
870
						$file_name  = 'edit-tags.php';
871
						$query_args = array(
872
							'taxonomy' => $args->options['pick_val'],
873
						);
874
					}
875
				}
876
877
				break;
878
879
			case 'user':
880
				if ( current_user_can( 'create_users' ) ) {