Code Duplication    Length = 7-9 lines in 2 locations

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

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

modules/widgets/facebook-likebox.php 1 location

@@ 284-292 (lines=9) @@
281
		return (int) $value;
282
	}
283
284
	function normalize_text_value( $value, $default = '', $allowed = array() ) {
285
		$allowed = (array) $allowed;
286
287
		if ( empty( $value ) || ( ! empty( $allowed ) && ! in_array( $value, $allowed ) ) ) {
288
			$value = $default;
289
		}
290
291
		return $value;
292
	}
293
294
	/**
295
	 * @deprecated