Code Duplication    Length = 7-9 lines in 2 locations

modules/widgets/eu-cookie-law.php 1 location

@@ 288-294 (lines=7) @@
285
		 *
286
		 * @return string $value if pass the check or first value from allowed values.
287
		 */
288
		function filter_value( $value, $allowed = array() ) {
289
			$allowed = (array) $allowed;
290
			if ( empty( $value ) || ( ! empty( $allowed ) && ! in_array( $value, $allowed ) ) ) {
291
				$value = $allowed[0];
292
			}
293
			return $value;
294
		}
295
	}
296
297
	// Register Jetpack_EU_Cookie_Law_Widget widget.

modules/widgets/facebook-likebox.php 1 location

@@ 307-315 (lines=9) @@
304
		return (int) $value;
305
	}
306
307
	function normalize_text_value( $value, $default = '', $allowed = array() ) {
308
		$allowed = (array) $allowed;
309
310
		if ( empty( $value ) || ( ! empty( $allowed ) && ! in_array( $value, $allowed ) ) ) {
311
			$value = $default;
312
		}
313
314
		return $value;
315
	}
316
317
	/**
318
	 * @deprecated