Ticket #35658: 35658.20.diff
File 35658.20.diff, 1.5 KB (added by , 8 years ago) |
---|
-
src/wp-includes/meta.php
1002 1002 * @type string $sanitize_callback A function or method to call when sanitizing `$meta_key` data. 1003 1003 * @type string $auth_callback Optional. A function or method to call when performing edit_post_meta, add_post_meta, and delete_post_meta capability checks. 1004 1004 * @type bool $show_in_rest Whether data associated with this meta key can be considered public. 1005 * @type bool $single Whether the meta key has one value per object, or an array of values per object. 1005 1006 * } 1006 1007 * @param string|array $auth_callback Deprecated. Use `$args` instead. 1007 1008 * … … 1028 1029 'sanitize_callback' => null, 1029 1030 'auth_callback' => null, 1030 1031 'show_in_rest' => false, 1032 'single' => false, 1031 1033 ); 1032 1034 1033 1035 $passed_args = array_slice( func_get_args(), 2 ); … … 1227 1229 return new WP_Error( 'invalid_meta_key', __( 'Invalid meta key. Not registered.' ) ); 1228 1230 } 1229 1231 $meta_keys = get_registered_meta_keys( $object_type, $object_subtype ); 1230 $meta_key_data = $meta_keys[ $ object_type ][ $object_subtype ][ $meta_key ];1232 $meta_key_data = $meta_keys[ $meta_key ]; 1231 1233 1232 $data = get_metadata( $object_type, $object_id, $meta_key, $meta_key_data ->single);1234 $data = get_metadata( $object_type, $object_id, $meta_key, $meta_key_data['single'] ); 1233 1235 1234 1236 return $data; 1235 1237 }