Changeset 45064
- Timestamp:
- 03/28/2019 09:58:45 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/meta.php
r45036 r45064 813 813 // Fetch the meta and go on if it's found. 814 814 if ( $meta = get_metadata_by_mid( $meta_type, $meta_id ) ) { 815 $object_id = $meta->{$column};815 $object_id = (int) $meta->{$column}; 816 816 817 817 /** This action is documented in wp-includes/meta.php */ -
trunk/tests/phpunit/tests/meta/deleteMetadata.php
r42343 r45064 145 145 $this->assertFalse( $p2_cache ); 146 146 } 147 148 /** 149 * @ticket 43561 150 */ 151 public function test_object_id_is_int_inside_delete_post_meta() { 152 $post_id = self::factory()->post->create(); 153 $meta_id = add_metadata( 'post', $post_id, 'my_key', 'my_value' ); 154 add_action( 'delete_post_meta', [ $this, 'action_check_object_id_is_int' ], 10, 2 ); 155 delete_metadata_by_mid( 'post', $meta_id ); 156 } 157 158 public function action_check_object_id_is_int( $meta_type, $object_id ) { 159 $this->assertEquals( 160 'integer', 161 gettype( $object_id ) 162 ); 163 } 147 164 }
Note: See TracChangeset
for help on using the changeset viewer.