Code Duplication    Length = 7-8 lines in 3 locations

classes/PodsUI.php 1 location

@@ 4733-4739 (lines=7) @@
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, ' {@}' );
4742
		$tag = explode( ',', $tag );

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 );

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 );