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

@@ 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