Code Duplication    Length = 7-9 lines in 3 locations

classes/PodsMeta.php 3 locations

@@ 417-425 (lines=9) @@
414
        if ( !isset( self::$queue[ $type ] ) )
415
            self::$queue[ $type ] = array();
416
417
        if ( is_array( $pod ) && !empty( $pod ) && !isset( $pod[ 'name' ] ) ) {
418
            $data = array();
419
420
            foreach ( $pod as $p ) {
421
                $data[] = $this->register( $type, $p );
422
            }
423
424
            return $data;
425
        }
426
427
        $pod[ 'type' ] = $pod_type;
428
        $pod = pods_api()->save_pod( $pod, false, false );
@@ 442-450 (lines=9) @@
439
    }
440
441
    public function register_field ( $pod, $field ) {
442
        if ( is_array( $pod ) && !empty( $pod ) && !isset( $pod[ 'name' ] ) ) {
443
            $data = array();
444
445
            foreach ( $pod as $p ) {
446
                $data[] = $this->register_field( $p, $field );
447
            }
448
449
            return $data;
450
        }
451
452
        if ( empty( self::$current_pod_data ) || !is_object( self::$current_pod_data ) || self::$current_pod_data[ 'name' ] != $pod )
453
            self::$current_pod_data = pods_api()->load_pod( array( 'name' => $pod ), false );
@@ 663-669 (lines=7) @@
660
     * @return mixed|void
661
     */
662
    public function group_add ( $pod, $label, $fields, $context = 'normal', $priority = 'default' ) {
663
        if ( is_array( $pod ) && !empty( $pod ) && !isset( $pod[ 'name' ] ) ) {
664
            foreach ( $pod as $p ) {
665
                $this->group_add( $pod, $label, $fields, $context, $priority );
666
            }
667
668
            return true;
669
        }
670
671
        if ( !is_array( $pod ) ) {
672
            if ( empty( self::$current_pod_data ) || !is_object( self::$current_pod_data ) || self::$current_pod_data[ 'name' ] != $pod )