Code Duplication    Length = 3-8 lines in 5 locations

components/Templates/includes/functions-view_template.php 1 location

@@ 356-363 (lines=8) @@
353
		function( $tag ) use ( $pod, $data, $skip_unknown ) {
354
355
			// This is essentially Pods->process_magic_tags() but with the Pods specific code ripped out
356
			if ( is_array( $tag ) ) {
357
				if ( !isset( $tag[ 2 ] ) && strlen( trim( $tag[ 2 ] ) ) < 1 ) {
358
					return '';
359
				}
360
361
				$original_tag = $tag[0];
362
				$tag = $tag[ 2 ];
363
			}
364
365
			$tag = trim( $tag, ' {@}' );
366
			$tag = explode( ',', $tag );

classes/Pods.php 1 location

@@ 3706-3711 (lines=6) @@
3703
	 */
3704
	private function process_magic_tags ( $tag ) {
3705
3706
		if ( is_array( $tag ) ) {
3707
			if ( !isset( $tag[ 2 ] ) && strlen( trim( $tag[ 2 ] ) ) < 1 )
3708
				return '';
3709
3710
			$tag = $tag[ 2 ];
3711
		}
3712
3713
		$tag = trim( $tag, ' {@}' );
3714
		$tag = explode( ',', $tag );

classes/fields/file.php 1 location

@@ 655-657 (lines=3) @@
652
			$title = false;
653
654
			if ( is_array( $id ) ) {
655
				if ( isset( $id['title'] ) && 0 < strlen( trim( $id['title'] ) ) ) {
656
					$title = trim( $id['title'] );
657
				}
658
659
				if ( isset( $id['id'] ) ) {
660
					$id = (int) $id['id'];

classes/PodsUI.php 1 location

@@ 4733-4738 (lines=6) @@
4730
	 */
4731
	public function do_magic_tags( $tag ) {
4732
4733
		if ( is_array( $tag ) ) {
4734
			if ( ! isset( $tag[2] ) && strlen( trim( $tag[2] ) ) < 1 ) {
4735
				return '';
4736
			}
4737
4738
			$tag = $tag[2];
4739
		}
4740
4741
		$tag = trim( $tag, ' {@}' );

includes/data.php 1 location

@@ 1535-1541 (lines=7) @@
1532
	global $wpdb;
1533
1534
	// Handle pods_evaluate_tags
1535
	if ( is_array( $tag ) ) {
1536
		if ( ! isset( $tag[2] ) && strlen( trim( $tag[2] ) ) < 1 ) {
1537
			return '';
1538
		}
1539
1540
		$tag = $tag[2];
1541
	}
1542
1543
	$tag = trim( $tag, ' {@}' );
1544
	$tag = explode( '.', $tag );