Code Duplication    Length = 2-6 lines in 7 locations

classes/PodsMeta.php 7 locations

@@ 400-401 (lines=2) @@
397
            return $data;
398
        }
399
400
        if ( empty( self::$current_pod_data ) || !is_object( self::$current_pod_data ) || self::$current_pod_data[ 'name' ] != $pod )
401
            self::$current_pod_data = pods_api()->load_pod( array( 'name' => $pod ), false );
402
403
        $pod = self::$current_pod_data;
404
@@ 461-462 (lines=2) @@
458
            $object = $storage_model->taxonomy;
459
        }
460
461
        if ( empty( self::$current_pod_data ) || !is_object( self::$current_pod_data ) || self::$current_pod_data[ 'name' ] != $object )
462
            self::$current_pod_data = pods_api()->load_pod( array( 'name' => $object ), false );
463
464
        $pod = self::$current_pod_data;
465
@@ 524-525 (lines=2) @@
521
        $field = substr( $obj->get_option( 'field' ), 0, 10 ) == "cpachidden" ? str_replace( 'cpachidden', '', $obj->get_option( 'field' ) ) : $obj->get_option( 'field' );
522
        $field_type = $obj->get_option( 'field_type' );
523
524
        if ( empty( self::$current_pod_data ) || !is_object( self::$current_pod_data ) || self::$current_pod_data[ 'name' ] != $object )
525
            self::$current_pod_data = pods_api()->load_pod( array( 'name' => $object ), false );
526
527
        $pod = self::$current_pod_data;
528
@@ 572-573 (lines=2) @@
569
        elseif ( 'wp-comments' == $type )
570
            $object = 'comment';
571
572
        if ( empty( self::$current_pod_data ) || !is_object( self::$current_pod_data ) || self::$current_pod_data[ 'name' ] != $object )
573
            self::$current_pod_data = pods_api()->load_pod( array( 'name' => $object ), false );
574
575
        $pod = self::$current_pod_data;
576
@@ 620-621 (lines=2) @@
617
        }
618
619
        if ( !is_array( $pod ) ) {
620
            if ( empty( self::$current_pod_data ) || !is_object( self::$current_pod_data ) || self::$current_pod_data[ 'name' ] != $pod )
621
                self::$current_pod_data = pods_api()->load_pod( array( 'name' => $pod ), false );
622
623
            if ( !empty( self::$current_pod_data ) )
624
                $pod = self::$current_pod_data;
@@ 789-794 (lines=6) @@
786
787
        if ( 'pod' != $type && !empty( $object ) && is_array( $object ) && isset( $object[ $name ] ) )
788
            $pod = $object[ $name ];
789
        else {
790
            if ( empty( self::$current_pod_data ) || !is_object( self::$current_pod_data ) || self::$current_pod_data[ 'name' ] != $name )
791
                self::$current_pod_data = pods_api()->load_pod( array( 'name' => $name ), false );
792
793
            $pod = self::$current_pod_data;
794
        }
795
796
        if ( empty( $pod ) )
797
            return array();
@@ 854-855 (lines=2) @@
851
        if ( !empty( $object ) && is_array( $object ) && isset( $object[ $name ] ) )
852
            $fields = $object[ $name ][ 'fields' ];
853
        else {
854
            if ( empty( self::$current_pod_data ) || !is_object( self::$current_pod_data ) || self::$current_pod_data[ 'name' ] != $name )
855
                self::$current_pod_data = pods_api()->load_pod( array( 'name' => $name ), false );
856
857
            $pod = self::$current_pod_data;
858