Code Duplication    Length = 2-7 lines in 4 locations

classes/PodsUI.php 1 location

@@ 3946-3951 (lines=6) @@
3943
     * @return string
3944
     */
3945
    public function do_magic_tags ( $tag ) {
3946
        if ( is_array( $tag ) ) {
3947
            if ( !isset( $tag[ 2 ] ) && strlen( trim( $tag[ 2 ] ) ) < 1 )
3948
                return '';
3949
3950
            $tag = $tag[ 2 ];
3951
        }
3952
3953
        $tag = trim( $tag, ' {@}' );
3954
        $tag = explode( ',', $tag );

classes/fields/file.php 1 location

@@ 390-391 (lines=2) @@
387
            $title = false;
388
389
            if ( is_array( $id ) ) {
390
                if ( isset( $id[ 'title' ] ) && 0 < strlen( trim( $id[ 'title' ] ) ) )
391
                    $title = trim( $id[ 'title' ] );
392
393
                if ( isset( $id[ 'id' ] ) )
394
                    $id = (int) $id[ 'id' ];

classes/Pods.php 1 location

@@ 3580-3585 (lines=6) @@
3577
	 */
3578
	private function process_magic_tags ( $tag ) {
3579
3580
		if ( is_array( $tag ) ) {
3581
			if ( !isset( $tag[ 2 ] ) && strlen( trim( $tag[ 2 ] ) ) < 1 )
3582
				return '';
3583
3584
			$tag = $tag[ 2 ];
3585
		}
3586
3587
		$tag = trim( $tag, ' {@}' );
3588
		$tag = explode( ',', $tag );

includes/data.php 1 location

@@ 1562-1568 (lines=7) @@
1559
	global $wpdb;
1560
1561
	// Handle pods_evaluate_tags
1562
	if ( is_array( $tag ) ) {
1563
		if ( !isset( $tag[ 2 ] ) && strlen( trim( $tag[ 2 ] ) ) < 1 ) {
1564
			return '';
1565
		}
1566
1567
		$tag = $tag[ 2 ];
1568
	}
1569
1570
	$tag = trim( $tag, ' {@}' );
1571
	$tag = explode( '.', $tag );