Code Duplication    Length = 9-10 lines in 3 locations

classes/PodsAPI.php 3 locations

@@ 5228-5236 (lines=9) @@
5225
        $params = (object) pods_sanitize( $params );
5226
5227
        if ( !empty( $params->id ) || !empty( $params->name ) ) {
5228
            if ( !isset( $params->name ) )
5229
                $pod = get_post( $dummy = (int) $params->id );
5230
            else {
5231
                $pod = get_posts( array(
5232
                    'name' => $params->name,
5233
                    'post_type' => '_pods_pod',
5234
                    'posts_per_page' => 1
5235
                ) );
5236
            }
5237
5238
            if ( !empty( $pod ) && ( empty( $type ) || $type == get_post_meta( $pod->ID, 'type', true ) ) )
5239
                return true;
@@ 5367-5375 (lines=9) @@
5364
                }
5365
            }
5366
5367
            if ( !isset( $params->name ) )
5368
                $pod = get_post( $dummy = (int) $params->id );
5369
            else {
5370
                $pod = get_posts( array(
5371
                    'name' => $params->name,
5372
                    'post_type' => '_pods_pod',
5373
                    'posts_per_page' => 1
5374
                ) );
5375
            }
5376
5377
            if ( empty( $pod ) ) {
5378
                if ( $strict )
@@ 5812-5821 (lines=10) @@
5809
        $params = (object) pods_sanitize( $params );
5810
5811
        if ( ( !empty( $params->id ) || !empty( $params->name ) ) && isset( $params->pod_id ) && !empty( $params->pod_id ) ) {
5812
            if ( !isset( $params->name ) )
5813
                $field = get_post( $dummy = (int) $params->id );
5814
            else {
5815
                $field = get_posts( array(
5816
                    'name' => $params->name,
5817
                    'post_type' => '_pods_field',
5818
                    'posts_per_page' => 1,
5819
                    'post_parent' => $params->pod_id
5820
                ) );
5821
            }
5822
5823
            if ( !empty( $field ) )
5824
                return true;