Code Duplication    Length = 15-15 lines in 2 locations

classes/PodsAPI.php 2 locations

@@ 5588-5602 (lines=15) @@
5585
5586
        $pod[ 'options' ] = get_post_meta( $pod[ 'id' ] );
5587
5588
        foreach ( $pod[ 'options' ] as $option => $value ) {
5589
            if ( is_array( $value ) ) {
5590
                foreach ( $value as $k => $v ) {
5591
                    if ( !is_array( $v ) )
5592
                        $value[ $k ] = maybe_unserialize( $v );
5593
                }
5594
5595
                if ( 1 == count( $value ) )
5596
                    $value = current( $value );
5597
            }
5598
            else
5599
                $value = maybe_unserialize( $value );
5600
5601
            $pod[ 'options' ][ $option ] = $value;
5602
        }
5603
5604
        $pod[ 'options' ] = array_merge( $defaults, $pod[ 'options' ] );
5605
@@ 6170-6184 (lines=15) @@
6167
                        unset( $field[ 'options' ][ $ignore ] );
6168
                }
6169
6170
                foreach ( $field[ 'options' ] as $option => $value ) {
6171
                    if ( is_array( $value ) ) {
6172
                        foreach ( $value as $k => $v ) {
6173
                            if ( !is_array( $v ) )
6174
                                $value[ $k ] = maybe_unserialize( $v );
6175
                        }
6176
6177
                        if ( 1 == count( $value ) )
6178
                            $value = current( $value );
6179
                    }
6180
                    else
6181
                        $value = maybe_unserialize( $value );
6182
6183
                    $field[ 'options' ][ $option ] = $value;
6184
                }
6185
6186
                $field[ 'options' ] = array_merge( $defaults, $field[ 'options' ] );
6187