Code Duplication    Length = 15-15 lines in 2 locations

core/Container/Post_Meta_Container.php 1 location

@@ 288-302 (lines=15) @@
285
	 * 
286
	 * @return array<string>
287
	 */
288
	public function get_post_type_visibility() {
289
		$all_post_types = get_post_types();
290
		$filtered_collection = $this->conditions_collection->filter( array( 'post_type' ) );
291
292
		$shown_on = array();
293
		foreach ( $all_post_types as $post_type ) {
294
			$environment = array(
295
				'post_type' => $post_type,
296
			);
297
			if ( $filtered_collection->is_fulfilled( $environment ) ) {
298
				$shown_on[] = $post_type;
299
			}
300
		}
301
		return $shown_on;
302
	}
303
304
	/**
305
	 * COMMON USAGE METHODS

core/Container/Term_Meta_Container.php 1 location

@@ 210-224 (lines=15) @@
207
	 * 
208
	 * @return array<string>
209
	 */
210
	public function get_taxonomy_visibility() {
211
		$all_taxonomies = get_taxonomies();
212
		$filtered_collection = $this->conditions_collection->filter( array( 'term_taxonomy' ) );
213
214
		$shown_on = array();
215
		foreach ( $all_taxonomies as $taxonomy ) {
216
			$environment = array(
217
				'taxonomy' => $taxonomy,
218
			);
219
			if ( $filtered_collection->is_fulfilled( $environment ) ) {
220
				$shown_on[] = $taxonomy;
221
			}
222
		}
223
		return $shown_on;
224
	}
225
226
	/**
227
	 * COMMON USAGE METHODS