Code Duplication    Length = 9-9 lines in 3 locations

core/db_models/EEM_Term_Taxonomy.model.php 1 location

@@ 104-112 (lines=9) @@
101
	 * @param EEM_Base $model
102
	 * @return array
103
	 */
104
	public static function rest_api_query_params( $model_query_params, $querystring_query_params, $model ) {
105
		if( $model === EEM_Term_Taxonomy::instance() ) {
106
			$taxonomies = get_taxonomies( array( 'show_in_rest' => true) );
107
			if( ! empty( $taxonomies ) ) {
108
				$model_query_params[0][ 'taxonomy' ] = array( 'IN', $taxonomies );
109
			}
110
		}
111
		return $model_query_params;
112
	}
113
}
114
// End of file EEM_Term_Taxonomy.model.php
115
// Location: /includes/models/EEM_Term_Taxonomy.model.php

core/db_models/EEM_Term.model.php 1 location

@@ 203-211 (lines=9) @@
200
	 * @param EEM_Base $model
201
	 * @return array
202
	 */
203
	public static function rest_api_query_params( $model_query_params, $querystring_query_params, $model ) {
204
		if ( $model === EEM_Term::instance() ) {
205
			$taxonomies = get_taxonomies( array( 'show_in_rest' => true ) );
206
			if ( ! empty( $taxonomies ) ) {
207
				$model_query_params[0]['Term_Taxonomy.taxonomy'] = array( 'IN', $taxonomies );
208
			}
209
		}
210
		return $model_query_params;
211
	}
212
213
214

core/db_models/EEM_Term_Relationship.model.php 1 location

@@ 215-223 (lines=9) @@
212
	 * @param EEM_Base $model
213
	 * @return array
214
	 */
215
	public static function rest_api_query_params( $model_query_params, $querystring_query_params, $model ) {
216
		if ( $model === EEM_Term_Relationship::instance() ) {
217
			$taxonomies = get_taxonomies( array( 'show_in_rest' => true ) );
218
			if ( ! empty( $taxonomies ) ) {
219
				$model_query_params[0]['Term_Taxonomy.taxonomy'] = array( 'IN', $taxonomies );
220
			}
221
		}
222
		return $model_query_params;
223
	}
224
225
226
}