Code Duplication    Length = 9-10 lines in 3 locations

classes/PodsAPI.php 3 locations

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