Code Duplication    Length = 15-15 lines in 2 locations

classes/PodsAPI.php 2 locations

@@ 5721-5735 (lines=15) @@
5718
5719
        $pod[ 'options' ] = get_post_meta( $pod[ 'id' ] );
5720
5721
        foreach ( $pod[ 'options' ] as $option => $value ) {
5722
            if ( is_array( $value ) ) {
5723
                foreach ( $value as $k => $v ) {
5724
                    if ( !is_array( $v ) )
5725
                        $value[ $k ] = maybe_unserialize( $v );
5726
                }
5727
5728
                if ( 1 == count( $value ) )
5729
                    $value = current( $value );
5730
            }
5731
            else
5732
                $value = maybe_unserialize( $value );
5733
5734
            $pod[ 'options' ][ $option ] = $value;
5735
        }
5736
5737
        $pod[ 'options' ] = array_merge( $defaults, $pod[ 'options' ] );
5738
@@ 6303-6317 (lines=15) @@
6300
                        unset( $field[ 'options' ][ $ignore ] );
6301
                }
6302
6303
                foreach ( $field[ 'options' ] as $option => $value ) {
6304
                    if ( is_array( $value ) ) {
6305
                        foreach ( $value as $k => $v ) {
6306
                            if ( !is_array( $v ) )
6307
                                $value[ $k ] = maybe_unserialize( $v );
6308
                        }
6309
6310
                        if ( 1 == count( $value ) )
6311
                            $value = current( $value );
6312
                    }
6313
                    else
6314
                        $value = maybe_unserialize( $value );
6315
6316
                    $field[ 'options' ][ $option ] = $value;
6317
                }
6318
6319
                $field[ 'options' ] = array_merge( $defaults, $field[ 'options' ] );
6320