Code Duplication    Length = 15-15 lines in 2 locations

classes/PodsAPI.php 2 locations

@@ 5630-5644 (lines=15) @@
5627
5628
        $pod[ 'options' ] = get_post_meta( $pod[ 'id' ] );
5629
5630
        foreach ( $pod[ 'options' ] as $option => $value ) {
5631
            if ( is_array( $value ) ) {
5632
                foreach ( $value as $k => $v ) {
5633
                    if ( !is_array( $v ) )
5634
                        $value[ $k ] = maybe_unserialize( $v );
5635
                }
5636
5637
                if ( 1 == count( $value ) )
5638
                    $value = current( $value );
5639
            }
5640
            else
5641
                $value = maybe_unserialize( $value );
5642
5643
            $pod[ 'options' ][ $option ] = $value;
5644
        }
5645
5646
        $pod[ 'options' ] = array_merge( $defaults, $pod[ 'options' ] );
5647
@@ 6212-6226 (lines=15) @@
6209
                        unset( $field[ 'options' ][ $ignore ] );
6210
                }
6211
6212
                foreach ( $field[ 'options' ] as $option => $value ) {
6213
                    if ( is_array( $value ) ) {
6214
                        foreach ( $value as $k => $v ) {
6215
                            if ( !is_array( $v ) )
6216
                                $value[ $k ] = maybe_unserialize( $v );
6217
                        }
6218
6219
                        if ( 1 == count( $value ) )
6220
                            $value = current( $value );
6221
                    }
6222
                    else
6223
                        $value = maybe_unserialize( $value );
6224
6225
                    $field[ 'options' ][ $option ] = $value;
6226
                }
6227
6228
                $field[ 'options' ] = array_merge( $defaults, $field[ 'options' ] );
6229