Code Duplication    Length = 7-9 lines in 3 locations

classes/PodsMeta.php 3 locations

@@ 365-373 (lines=9) @@
362
        if ( !isset( self::$queue[ $type ] ) )
363
            self::$queue[ $type ] = array();
364
365
        if ( is_array( $pod ) && !empty( $pod ) && !isset( $pod[ 'name' ] ) ) {
366
            $data = array();
367
368
            foreach ( $pod as $p ) {
369
                $data[] = $this->register( $type, $p );
370
            }
371
372
            return $data;
373
        }
374
375
        $pod[ 'type' ] = $pod_type;
376
        $pod = pods_api()->save_pod( $pod, false, false );
@@ 390-398 (lines=9) @@
387
    }
388
389
    public function register_field ( $pod, $field ) {
390
        if ( is_array( $pod ) && !empty( $pod ) && !isset( $pod[ 'name' ] ) ) {
391
            $data = array();
392
393
            foreach ( $pod as $p ) {
394
                $data[] = $this->register_field( $p, $field );
395
            }
396
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 );
@@ 611-617 (lines=7) @@
608
     * @return mixed|void
609
     */
610
    public function group_add ( $pod, $label, $fields, $context = 'normal', $priority = 'default' ) {
611
        if ( is_array( $pod ) && !empty( $pod ) && !isset( $pod[ 'name' ] ) ) {
612
            foreach ( $pod as $p ) {
613
                $this->group_add( $pod, $label, $fields, $context, $priority );
614
            }
615
616
            return true;
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 )