[wp-trac] [WordPress Trac] #10487: Improved meta API

WordPress Trac wp-trac at lists.automattic.com
Sun Jul 26 00:04:12 UTC 2009


#10487: Improved meta API
-----------------------------+----------------------------------------------
 Reporter:  scribu           |       Owner:                                      
     Type:  feature request  |      Status:  new                                 
 Priority:  normal           |   Milestone:  2.9                                 
Component:  General          |     Version:                                      
 Severity:  normal           |    Keywords:  has-patch needs-testing dev-feedback
-----------------------------+----------------------------------------------

Comment(by scribu):

 This patch:

 - replaces postmeta with a generic meta table

 - the meta table has enum as meta_type for better performance

 - implements these functions:

 {{{
 register_meta_type($meta_type);

 add_metadata($meta_type, $object_id, $meta_key, $meta_value, $unique =
 false);

 update_metadata($meta_type, $object_id, $meta_key, $meta_value,
 $prev_value = '');

 delete_metadata($meta_type, $object_id, $meta_key = '', $meta_value = '');

 get_metadata($meta_type, $object_id, $key = '', $single = false);
 }}}

 Notice that $meta_key is optional for delete_metadata() and
 get_metadata().


 - maps these functions:

 {{{
 add_post_meta();

 update_post_meta();

 delete_post_meta();

 get_post_meta();

 get_post_custom();
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10487#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list