Changeset 27562
- Timestamp:
- 03/17/2014 07:39:31 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/meta.php
r27191 r27562 324 324 $check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, true ); 325 325 if ( null !== $check ) 326 return true;326 return (bool) $check; 327 327 328 328 $meta_cache = wp_cache_get( $object_id, $meta_type . '_meta' ); -
trunk/tests/phpunit/tests/meta.php
r26307 r27562 82 82 $this->assertFalse( metadata_exists( 'user', 1234567890, 'foobarbaz' ) ); 83 83 $this->assertFalse( metadata_exists( 'user', 1234567890, 'meta_key' ) ); 84 } 85 86 /** 87 * @ticket 22746 88 */ 89 function test_metadata_exists_with_filter() { 90 // Let's see if it returns the correct value when adding a filter. 91 add_filter( 'get_user_metadata', '__return_zero' ); 92 $this->assertFalse( metadata_exists( 'user', $this->author->ID, 'meta_key' ) ); // existing meta key 93 $this->assertFalse( metadata_exists( 'user', 1234567890, 'meta_key' ) ); 94 remove_filter( 'get_user_metadata', '__return_zero' ); 84 95 } 85 96
Note: See TracChangeset
for help on using the changeset viewer.