Code Duplication    Length = 15-15 lines in 2 locations

classes/PodsAPI.php 2 locations

@@ 5663-5677 (lines=15) @@
5660
5661
        $pod[ 'options' ] = get_post_meta( $pod[ 'id' ] );
5662
5663
        foreach ( $pod[ 'options' ] as $option => $value ) {
5664
            if ( is_array( $value ) ) {
5665
                foreach ( $value as $k => $v ) {
5666
                    if ( !is_array( $v ) )
5667
                        $value[ $k ] = maybe_unserialize( $v );
5668
                }
5669
5670
                if ( 1 == count( $value ) )
5671
                    $value = current( $value );
5672
            }
5673
            else
5674
                $value = maybe_unserialize( $value );
5675
5676
            $pod[ 'options' ][ $option ] = $value;
5677
        }
5678
5679
        $pod[ 'options' ] = array_merge( $defaults, $pod[ 'options' ] );
5680
@@ 6245-6259 (lines=15) @@
6242
                        unset( $field[ 'options' ][ $ignore ] );
6243
                }
6244
6245
                foreach ( $field[ 'options' ] as $option => $value ) {
6246
                    if ( is_array( $value ) ) {
6247
                        foreach ( $value as $k => $v ) {
6248
                            if ( !is_array( $v ) )
6249
                                $value[ $k ] = maybe_unserialize( $v );
6250
                        }
6251
6252
                        if ( 1 == count( $value ) )
6253
                            $value = current( $value );
6254
                    }
6255
                    else
6256
                        $value = maybe_unserialize( $value );
6257
6258
                    $field[ 'options' ][ $option ] = $value;
6259
                }
6260
6261
                $field[ 'options' ] = array_merge( $defaults, $field[ 'options' ] );
6262