Code Duplication    Length = 5-5 lines in 4 locations

src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php 1 location

@@ 206-210 (lines=5) @@
203
		 * For each known parameter which is both registered and present in the request,
204
		 * set the parameter's value on the query $prepared_args.
205
		 */
206
		foreach ( $parameter_mappings as $api_param => $wp_param ) {
207
			if ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) {
208
				$prepared_args[ $wp_param ] = $request[ $api_param ];
209
			}
210
		}
211
212
		// Ensure certain parameter values default to empty strings.
213
		foreach ( array( 'author_email', 'search' ) as $param ) {

src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 1 location

@@ 197-201 (lines=5) @@
194
		 * For each known parameter which is both registered and present in the request,
195
		 * set the parameter's value on the query $args.
196
		 */
197
		foreach ( $parameter_mappings as $api_param => $wp_param ) {
198
			if ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) {
199
				$args[ $wp_param ] = $request[ $api_param ];
200
			}
201
		}
202
203
		// Check for & assign any parameters which require special handling or setting.
204
		$args['date_query'] = array();

src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php 1 location

@@ 193-197 (lines=5) @@
190
		 * For each known parameter which is both registered and present in the request,
191
		 * set the parameter's value on the query $prepared_args.
192
		 */
193
		foreach ( $parameter_mappings as $api_param => $wp_param ) {
194
			if ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) {
195
				$prepared_args[ $wp_param ] = $request[ $api_param ];
196
			}
197
		}
198
199
		if ( isset( $registered['offset'] ) && ! empty( $request['offset'] ) ) {
200
			$prepared_args['offset'] = $request['offset'];

src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php 1 location

@@ 233-237 (lines=5) @@
230
		 * For each known parameter which is both registered and present in the request,
231
		 * set the parameter's value on the query $prepared_args.
232
		 */
233
		foreach ( $parameter_mappings as $api_param => $wp_param ) {
234
			if ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) {
235
				$prepared_args[ $wp_param ] = $request[ $api_param ];
236
			}
237
		}
238
239
		if ( isset( $registered['offset'] ) && ! empty( $request['offset'] ) ) {
240
			$prepared_args['offset'] = $request['offset'];