Code Duplication    Length = 2-6 lines in 7 locations

classes/PodsMeta.php 7 locations

@@ 383-384 (lines=2) @@
380
            return $data;
381
        }
382
383
        if ( empty( self::$current_pod_data ) || !is_object( self::$current_pod_data ) || self::$current_pod_data[ 'name' ] != $pod )
384
            self::$current_pod_data = pods_api()->load_pod( array( 'name' => $pod ), false );
385
386
        $pod = self::$current_pod_data;
387
@@ 444-445 (lines=2) @@
441
            $object = $storage_model->taxonomy;
442
        }
443
444
        if ( empty( self::$current_pod_data ) || !is_object( self::$current_pod_data ) || self::$current_pod_data[ 'name' ] != $object )
445
            self::$current_pod_data = pods_api()->load_pod( array( 'name' => $object ), false );
446
447
        $pod = self::$current_pod_data;
448
@@ 507-508 (lines=2) @@
504
        $field = substr( $obj->options->field, 0, 10 ) == "cpachidden" ? str_replace( 'cpachidden', '', $obj->options->field ) : $obj->options->field;
505
        $field_type = $obj->options->field_type;
506
507
        if ( empty( self::$current_pod_data ) || !is_object( self::$current_pod_data ) || self::$current_pod_data[ 'name' ] != $object )
508
            self::$current_pod_data = pods_api()->load_pod( array( 'name' => $object ), false );
509
510
        $pod = self::$current_pod_data;
511
@@ 555-556 (lines=2) @@
552
        elseif ( 'wp-comments' == $type )
553
            $object = 'comment';
554
555
        if ( empty( self::$current_pod_data ) || !is_object( self::$current_pod_data ) || self::$current_pod_data[ 'name' ] != $object )
556
            self::$current_pod_data = pods_api()->load_pod( array( 'name' => $object ), false );
557
558
        $pod = self::$current_pod_data;
559
@@ 603-604 (lines=2) @@
600
        }
601
602
        if ( !is_array( $pod ) ) {
603
            if ( empty( self::$current_pod_data ) || !is_object( self::$current_pod_data ) || self::$current_pod_data[ 'name' ] != $pod )
604
                self::$current_pod_data = pods_api()->load_pod( array( 'name' => $pod ), false );
605
606
            if ( !empty( self::$current_pod_data ) )
607
                $pod = self::$current_pod_data;
@@ 772-777 (lines=6) @@
769
770
        if ( 'pod' != $type && !empty( $object ) && is_array( $object ) && isset( $object[ $name ] ) )
771
            $pod = $object[ $name ];
772
        else {
773
            if ( empty( self::$current_pod_data ) || !is_object( self::$current_pod_data ) || self::$current_pod_data[ 'name' ] != $name )
774
                self::$current_pod_data = pods_api()->load_pod( array( 'name' => $name ), false );
775
776
            $pod = self::$current_pod_data;
777
        }
778
779
        if ( empty( $pod ) )
780
            return array();
@@ 837-838 (lines=2) @@
834
        if ( !empty( $object ) && is_array( $object ) && isset( $object[ $name ] ) )
835
            $fields = $object[ $name ][ 'fields' ];
836
        else {
837
            if ( empty( self::$current_pod_data ) || !is_object( self::$current_pod_data ) || self::$current_pod_data[ 'name' ] != $name )
838
                self::$current_pod_data = pods_api()->load_pod( array( 'name' => $name ), false );
839
840
            $pod = self::$current_pod_data;
841