Code Duplication    Length = 15-15 lines in 2 locations

classes/PodsAPI.php 2 locations

@@ 5423-5437 (lines=15) @@
5420
5421
        $pod[ 'options' ] = get_post_meta( $pod[ 'id' ] );
5422
5423
        foreach ( $pod[ 'options' ] as $option => $value ) {
5424
            if ( is_array( $value ) ) {
5425
                foreach ( $value as $k => $v ) {
5426
                    if ( !is_array( $v ) )
5427
                        $value[ $k ] = maybe_unserialize( $v );
5428
                }
5429
5430
                if ( 1 == count( $value ) )
5431
                    $value = current( $value );
5432
            }
5433
            else
5434
                $value = maybe_unserialize( $value );
5435
5436
            $pod[ 'options' ][ $option ] = $value;
5437
        }
5438
5439
        $pod[ 'options' ] = array_merge( $defaults, $pod[ 'options' ] );
5440
@@ 5982-5996 (lines=15) @@
5979
                        unset( $field[ 'options' ][ $ignore ] );
5980
                }
5981
5982
                foreach ( $field[ 'options' ] as $option => $value ) {
5983
                    if ( is_array( $value ) ) {
5984
                        foreach ( $value as $k => $v ) {
5985
                            if ( !is_array( $v ) )
5986
                                $value[ $k ] = maybe_unserialize( $v );
5987
                        }
5988
5989
                        if ( 1 == count( $value ) )
5990
                            $value = current( $value );
5991
                    }
5992
                    else
5993
                        $value = maybe_unserialize( $value );
5994
5995
                    $field[ 'options' ][ $option ] = $value;
5996
                }
5997
5998
                $field[ 'options' ] = array_merge( $defaults, $field[ 'options' ] );
5999