Ticket #34405: 34405.diff
| File 34405.diff, 1.3 KB (added by , 10 years ago) |
|---|
-
src/wp-includes/post-functions.php
1950 1950 else 1951 1951 $value = format_to_edit($value); 1952 1952 } else { 1953 $value = esc_attr($value); 1953 if ( is_array( $value ) ) { 1954 $value = array_map( 'esc_attr', $value ); 1955 } else { 1956 $value = esc_attr( $value ); 1957 } 1954 1958 } 1955 1959 } elseif ( 'db' == $context ) { 1956 1960 if ( $prefixed ) { -
tests/phpunit/tests/post/meta.php
237 237 $this->assertEquals($funky_meta, get_post_meta($this->post_id, 'test_funky_post_meta', true)); 238 238 239 239 } 240 241 /** 242 * @ticket 34405 243 */ 244 function test_meta_array() { 245 //Value that we want to same and then look for. 246 $value = array( 247 'foo', 248 'bar' 249 ); 250 // Save the meta field 251 update_post_meta( $this->post_id, 'sampleValue', $value ); 252 253 // Full post 254 $full_post = get_post( $this->post_id, 'object', 'edit' ); 255 256 // Compare the values. 257 $this->assertEquals( $value, $full_post->sampleValue ); 258 } 259 240 260 }