Code Duplication    Length = 15-15 lines in 2 locations

classes/PodsAPI.php 2 locations

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