Code Duplication    Length = 15-15 lines in 2 locations

core/Container/Post_Meta_Container.php 1 location

@@ 264-278 (lines=15) @@
261
	 * 
262
	 * @return array<string>
263
	 */
264
	public function get_post_type_visibility() {
265
		$all_post_types = get_post_types();
266
		$filtered_collection = $this->condition_collection->filter( array( 'post_type' ) );
267
268
		$shown_on = array();
269
		foreach ( $all_post_types as $post_type ) {
270
			$environment = array(
271
				'post_type' => $post_type,
272
			);
273
			if ( $filtered_collection->is_fulfilled( $environment ) ) {
274
				$shown_on[] = $post_type;
275
			}
276
		}
277
		return $shown_on;
278
	}
279
280
	/**
281
	 * COMMON USAGE METHODS

core/Container/Term_Meta_Container.php 1 location

@@ 185-199 (lines=15) @@
182
	 * 
183
	 * @return array<string>
184
	 */
185
	public function get_taxonomy_visibility() {
186
		$all_taxonomies = get_taxonomies();
187
		$filtered_collection = $this->condition_collection->filter( array( 'term_taxonomy' ) );
188
189
		$shown_on = array();
190
		foreach ( $all_taxonomies as $taxonomy ) {
191
			$environment = array(
192
				'taxonomy' => $taxonomy,
193
			);
194
			if ( $filtered_collection->is_fulfilled( $environment ) ) {
195
				$shown_on[] = $taxonomy;
196
			}
197
		}
198
		return $shown_on;
199
	}
200
201
	/**
202
	 * COMMON USAGE METHODS