Code Duplication    Length = 35-35 lines in 3 locations

includes/post-types.php 3 locations

@@ 47-81 (lines=35) @@
44
45
		do_action( 'simcal_register_taxonomies' );
46
47
		if ( ! taxonomy_exists( 'calendar_feed' ) ) {
48
49
			// Feed Type.
50
			$labels = array(
51
				'name'                       => __( 'Events Source Types', 'google-calendar-events' ),
52
				'singular_name'              => __( 'Events Source Type', 'google-calendar-events' ),
53
				'menu_name'                  => __( 'Events Source Type', 'google-calendar-events' ),
54
				'all_items'                  => __( 'All Events Source Types', 'google-calendar-events' ),
55
				'parent_item'                => __( 'Parent Events Source Type', 'google-calendar-events' ),
56
				'parent_item_colon'          => __( 'Parent Events Source Type:', 'google-calendar-events' ),
57
				'new_item_name'              => __( 'New Events Source Type', 'google-calendar-events' ),
58
				'add_new_item'               => __( 'Add New Events Source Type', 'google-calendar-events' ),
59
				'edit_item'                  => __( 'Edit Events Source Type', 'google-calendar-events' ),
60
				'update_item'                => __( 'Update Events Source Type', 'google-calendar-events' ),
61
				'view_item'                  => __( 'View Events Source Type', 'google-calendar-events' ),
62
				'separate_items_with_commas' => __( 'Separate events source types with commas', 'google-calendar-events' ),
63
				'add_or_remove_items'        => __( 'Add or remove events source types', 'google-calendar-events' ),
64
				'choose_from_most_used'      => __( 'Choose from the most used', 'google-calendar-events' ),
65
				'popular_items'              => __( 'Popular events source types', 'google-calendar-events' ),
66
				'search_items'               => __( 'Search Events Source Types', 'google-calendar-events' ),
67
				'not_found'                  => __( 'Not Found', 'google-calendar-events' ),
68
			);
69
70
			$args   = array(
71
				'hierarchical'      => true,
72
				'labels'            => $labels,
73
				'public'            => false,
74
				'show_admin_column' => false,
75
				'show_in_nav_menus' => false,
76
				'show_tagcloud'     => false,
77
				'show_ui'           => false,
78
			);
79
			register_taxonomy( 'calendar_feed', array( 'calendar' ), $args );
80
81
		}
82
83
		if ( ! taxonomy_exists( 'calendar_type' ) ) {
84
@@ 83-117 (lines=35) @@
80
81
		}
82
83
		if ( ! taxonomy_exists( 'calendar_type' ) ) {
84
85
			// Calendar Type.
86
			$labels = array(
87
				'name'                       => __( 'Calendar Types', 'google-calendar-events' ),
88
				'singular_name'              => __( 'Calendar Type', 'google-calendar-events' ),
89
				'menu_name'                  => __( 'Calendar Type', 'google-calendar-events' ),
90
				'all_items'                  => __( 'All Calendar Types', 'google-calendar-events' ),
91
				'parent_item'                => __( 'Parent Calendar Type', 'google-calendar-events' ),
92
				'parent_item_colon'          => __( 'Parent Calendar Type:', 'google-calendar-events' ),
93
				'new_item_name'              => __( 'New Calendar Type', 'google-calendar-events' ),
94
				'add_new_item'               => __( 'Add New Calendar Type', 'google-calendar-events' ),
95
				'edit_item'                  => __( 'Edit Calendar Type', 'google-calendar-events' ),
96
				'update_item'                => __( 'Update Calendar Type', 'google-calendar-events' ),
97
				'view_item'                  => __( 'View Calendar Type', 'google-calendar-events' ),
98
				'separate_items_with_commas' => __( 'Separate calendar types with commas', 'google-calendar-events' ),
99
				'add_or_remove_items'        => __( 'Add or remove calendar types', 'google-calendar-events' ),
100
				'choose_from_most_used'      => __( 'Choose from the most used', 'google-calendar-events' ),
101
				'popular_items'              => __( 'Popular calendar types', 'google-calendar-events' ),
102
				'search_items'               => __( 'Search Calendar Types', 'google-calendar-events' ),
103
				'not_found'                  => __( 'Not Found', 'google-calendar-events' ),
104
			);
105
106
			$args   = array(
107
				'hierarchical'      => true,
108
				'labels'            => $labels,
109
				'public'            => false,
110
				'show_admin_column' => false,
111
				'show_in_nav_menus' => false,
112
				'show_tagcloud'     => false,
113
				'show_ui'           => false,
114
			);
115
			register_taxonomy( 'calendar_type', array( 'calendar' ), $args );
116
117
		}
118
119
		if ( ! taxonomy_exists( 'calendar_category' ) ) {
120
@@ 119-153 (lines=35) @@
116
117
		}
118
119
		if ( ! taxonomy_exists( 'calendar_category' ) ) {
120
121
			// Feed Category.
122
			$labels = array(
123
				'name'                       => __( 'Categories', 'google-calendar-events' ),
124
				'singular_name'              => __( 'Category', 'google-calendar-events' ),
125
				'menu_name'                  => __( 'Categories', 'google-calendar-events' ),
126
				'all_items'                  => __( 'All Categories', 'google-calendar-events' ),
127
				'parent_item'                => __( 'Parent Category', 'google-calendar-events' ),
128
				'parent_item_colon'          => __( 'Parent Category:', 'google-calendar-events' ),
129
				'new_item_name'              => __( 'New Category', 'google-calendar-events' ),
130
				'add_new_item'               => __( 'Add New Category', 'google-calendar-events' ),
131
				'edit_item'                  => __( 'Edit Category', 'google-calendar-events' ),
132
				'update_item'                => __( 'Update Category', 'google-calendar-events' ),
133
				'view_item'                  => __( 'View Category', 'google-calendar-events' ),
134
				'separate_items_with_commas' => __( 'Separate categories with commas', 'google-calendar-events' ),
135
				'add_or_remove_items'        => __( 'Add or remove categories', 'google-calendar-events' ),
136
				'choose_from_most_used'      => __( 'Choose from the most used', 'google-calendar-events' ),
137
				'popular_items'              => __( 'Popular Categories', 'google-calendar-events' ),
138
				'search_items'               => __( 'Search Categories', 'google-calendar-events' ),
139
				'not_found'                  => __( 'Not Found', 'google-calendar-events' ),
140
			);
141
142
			$args   = array(
143
				'hierarchical'      => true,
144
				'labels'            => $labels,
145
				'public'            => true,
146
				'show_admin_column' => true,
147
				'show_in_nav_menus' => true,
148
				'show_tagcloud'     => false,
149
				'show_ui'           => true,
150
			);
151
152
			register_taxonomy( 'calendar_category', array( 'calendar' ), $args );
153
		}
154
155
	}
156