Code Duplication    Length = 7-8 lines in 3 locations

modules/widgets/facebook-likebox.php 1 location

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

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

@@ 234-240 (lines=7) @@
231
		 *
232
		 * @return string $value if pass the check or first value from allowed values.
233
		 */
234
		function filter_value( $value, $allowed = array() ) {
235
			$allowed = (array) $allowed;
236
			if ( empty( $value ) || ( ! empty( $allowed ) && ! in_array( $value, $allowed ) ) ) {
237
				$value = $allowed[0];
238
			}
239
			return $value;
240
		}
241
	}
242
243
	// Register Jetpack_EU_Cookie_Law_Widget widget.

modules/widgets/googleplus-badge.php 1 location

@@ 311-318 (lines=8) @@
308
		return ( FALSE !== strpos( $url, 'plus.google.com' ) ) ? TRUE : FALSE;
309
	}
310
311
	function filter_text( $value, $default = '', $allowed = array() ) {
312
		$allowed = (array) $allowed;
313
314
		if ( empty( $value ) || ( ! empty( $allowed ) && ! in_array( $value, $allowed ) ) )
315
			$value = $default;
316
317
		return $value;
318
	}
319
}
320
321
// END