Code Duplication    Length = 13-13 lines in 2 locations

classes/fields/pick.php 2 locations

@@ 889-901 (lines=13) @@
886
887
		// Set the file name and args based on the content type of the relationship
888
		switch ( $args->options['pick_object'] ) {
889
			case 'post_type':
890
				if ( ! empty( $args->options['pick_val'] ) ) {
891
					$post_type_obj = get_post_type_object( $args->options['pick_val'] );
892
893
					if ( $post_type_obj && current_user_can( $post_type_obj->cap->create_posts ) ) {
894
						$file_name  = 'post-new.php';
895
						$query_args = array(
896
							'post_type' => $args->options['pick_val'],
897
						);
898
					}
899
				}
900
901
				break;
902
903
			case 'taxonomy':
904
				if ( ! empty( $args->options['pick_val'] ) ) {
@@ 903-915 (lines=13) @@
900
901
				break;
902
903
			case 'taxonomy':
904
				if ( ! empty( $args->options['pick_val'] ) ) {
905
					$taxonomy_obj = get_taxonomy( $args->options['pick_val'] );
906
907
					if ( $taxonomy_obj && current_user_can( $taxonomy_obj->cap->edit_terms ) ) {
908
						$file_name  = 'edit-tags.php';
909
						$query_args = array(
910
							'taxonomy' => $args->options['pick_val'],
911
						);
912
					}
913
				}
914
915
				break;
916
917
			case 'user':
918
				if ( current_user_can( 'create_users' ) ) {