Code Duplication    Length = 15-15 lines in 2 locations

classes/PodsAPI.php 2 locations

@@ 5989-6003 (lines=15) @@
5986
                        unset( $field[ 'options' ][ $ignore ] );
5987
                }
5988
5989
                foreach ( $field[ 'options' ] as $option => $value ) {
5990
                    if ( is_array( $value ) ) {
5991
                        foreach ( $value as $k => $v ) {
5992
                            if ( !is_array( $v ) )
5993
                                $value[ $k ] = maybe_unserialize( $v );
5994
                        }
5995
5996
                        if ( 1 == count( $value ) )
5997
                            $value = current( $value );
5998
                    }
5999
                    else
6000
                        $value = maybe_unserialize( $value );
6001
6002
                    $field[ 'options' ][ $option ] = $value;
6003
                }
6004
6005
                $field[ 'options' ] = array_merge( $defaults, $field[ 'options' ] );
6006
@@ 5433-5447 (lines=15) @@
5430
5431
        $pod[ 'options' ] = get_post_meta( $pod[ 'id' ] );
5432
5433
        foreach ( $pod[ 'options' ] as $option => $value ) {
5434
            if ( is_array( $value ) ) {
5435
                foreach ( $value as $k => $v ) {
5436
                    if ( !is_array( $v ) )
5437
                        $value[ $k ] = maybe_unserialize( $v );
5438
                }
5439
5440
                if ( 1 == count( $value ) )
5441
                    $value = current( $value );
5442
            }
5443
            else
5444
                $value = maybe_unserialize( $value );
5445
5446
            $pod[ 'options' ][ $option ] = $value;
5447
        }
5448
5449
        $pod[ 'options' ] = array_merge( $defaults, $pod[ 'options' ] );
5450