Code Duplication    Length = 9-10 lines in 3 locations

classes/PodsAPI.php 3 locations

@@ 5235-5243 (lines=9) @@
5232
        $params = (object) pods_sanitize( $params );
5233
5234
        if ( !empty( $params->id ) || !empty( $params->name ) ) {
5235
            if ( !isset( $params->name ) )
5236
                $pod = get_post( $dummy = (int) $params->id );
5237
            else {
5238
                $pod = get_posts( array(
5239
                    'name' => $params->name,
5240
                    'post_type' => '_pods_pod',
5241
                    'posts_per_page' => 1
5242
                ) );
5243
            }
5244
5245
            if ( !empty( $pod ) && ( empty( $type ) || $type == get_post_meta( $pod->ID, 'type', true ) ) )
5246
                return true;
@@ 5819-5828 (lines=10) @@
5816
        $params = (object) pods_sanitize( $params );
5817
5818
        if ( ( !empty( $params->id ) || !empty( $params->name ) ) && isset( $params->pod_id ) && !empty( $params->pod_id ) ) {
5819
            if ( !isset( $params->name ) )
5820
                $field = get_post( $dummy = (int) $params->id );
5821
            else {
5822
                $field = get_posts( array(
5823
                    'name' => $params->name,
5824
                    'post_type' => '_pods_field',
5825
                    'posts_per_page' => 1,
5826
                    'post_parent' => $params->pod_id
5827
                ) );
5828
            }
5829
5830
            if ( !empty( $field ) )
5831
                return true;
@@ 5377-5385 (lines=9) @@
5374
                }
5375
            }
5376
5377
            if ( !isset( $params->name ) )
5378
                $pod = get_post( $dummy = (int) $params->id );
5379
            else {
5380
                $pod = get_posts( array(
5381
                    'name' => $params->name,
5382
                    'post_type' => '_pods_pod',
5383
                    'posts_per_page' => 1
5384
                ) );
5385
            }
5386
5387
            if ( empty( $pod ) ) {
5388
                if ( $strict )