Code Duplication    Length = 15-15 lines in 2 locations

classes/PodsAPI.php 2 locations

@@ 5583-5597 (lines=15) @@
5580
5581
        $pod[ 'options' ] = get_post_meta( $pod[ 'id' ] );
5582
5583
        foreach ( $pod[ 'options' ] as $option => $value ) {
5584
            if ( is_array( $value ) ) {
5585
                foreach ( $value as $k => $v ) {
5586
                    if ( !is_array( $v ) )
5587
                        $value[ $k ] = maybe_unserialize( $v );
5588
                }
5589
5590
                if ( 1 == count( $value ) )
5591
                    $value = current( $value );
5592
            }
5593
            else
5594
                $value = maybe_unserialize( $value );
5595
5596
            $pod[ 'options' ][ $option ] = $value;
5597
        }
5598
5599
        $pod[ 'options' ] = array_merge( $defaults, $pod[ 'options' ] );
5600
@@ 6165-6179 (lines=15) @@
6162
                        unset( $field[ 'options' ][ $ignore ] );
6163
                }
6164
6165
                foreach ( $field[ 'options' ] as $option => $value ) {
6166
                    if ( is_array( $value ) ) {
6167
                        foreach ( $value as $k => $v ) {
6168
                            if ( !is_array( $v ) )
6169
                                $value[ $k ] = maybe_unserialize( $v );
6170
                        }
6171
6172
                        if ( 1 == count( $value ) )
6173
                            $value = current( $value );
6174
                    }
6175
                    else
6176
                        $value = maybe_unserialize( $value );
6177
6178
                    $field[ 'options' ][ $option ] = $value;
6179
                }
6180
6181
                $field[ 'options' ] = array_merge( $defaults, $field[ 'options' ] );
6182