Code Duplication    Length = 9-10 lines in 3 locations

classes/PodsAPI.php 3 locations

@@ 5325-5333 (lines=9) @@
5322
        $params = (object) pods_sanitize( $params );
5323
5324
        if ( !empty( $params->id ) || !empty( $params->name ) ) {
5325
            if ( !isset( $params->name ) )
5326
                $pod = get_post( $dummy = (int) $params->id );
5327
            else {
5328
                $pod = get_posts( array(
5329
                    'name' => $params->name,
5330
                    'post_type' => '_pods_pod',
5331
                    'posts_per_page' => 1
5332
                ) );
5333
            }
5334
5335
            if ( !empty( $pod ) && ( empty( $type ) || $type == get_post_meta( $pod->ID, 'type', true ) ) )
5336
                return true;
@@ 5518-5526 (lines=9) @@
5515
                }
5516
            }
5517
5518
            if ( !isset( $params->name ) )
5519
                $pod = get_post( $dummy = (int) $params->id );
5520
            else {
5521
                $pod = get_posts( array(
5522
                    'name' => $params->name,
5523
                    'post_type' => '_pods_pod',
5524
                    'posts_per_page' => 1
5525
                ) );
5526
            }
5527
5528
            if ( empty( $pod ) ) {
5529
                if ( $strict )
@@ 5983-5992 (lines=10) @@
5980
        $params = (object) pods_sanitize( $params );
5981
5982
        if ( ( !empty( $params->id ) || !empty( $params->name ) ) && isset( $params->pod_id ) && !empty( $params->pod_id ) ) {
5983
            if ( !isset( $params->name ) )
5984
                $field = get_post( $dummy = (int) $params->id );
5985
            else {
5986
                $field = get_posts( array(
5987
                    'name' => $params->name,
5988
                    'post_type' => '_pods_field',
5989
                    'posts_per_page' => 1,
5990
                    'post_parent' => $params->pod_id
5991
                ) );
5992
            }
5993
5994
            if ( !empty( $field ) )
5995
                return true;