[wp-trac] [WordPress Trac] #24696: Support for custom $meta_types with update_metadata()

WordPress Trac noreply at wordpress.org
Sat Jul 6 03:23:45 UTC 2013


#24696: Support for custom $meta_types with update_metadata()
-------------------------+------------------------------
 Reporter:  GaryJ        |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+------------------------------

Comment (by nacin):

 One obvious problem would be clashes. A 'comment' or 'user' post type, or
 a future 'term' meta type, could cause conflicts between meta types and
 post types. We already have a lot of namespace overlap in WordPress (ex:
 post types and taxonomies in many situations), and it would be nice to
 avoid a new one.

 The other thing is this filter would be inconsistently fired. Ideally a
 filter based on a post type would fire whenever an object of that post
 type is involved. But this would only work when the function was called
 with the proper arguments.

 So, that leads to one option which is, when meta type is 'post', to
 actually fetch the post and add the post's post type to the name of a new
 filter. While that is feasible, I don't think it is very necessary. The
 action already receives the ID — that's unnecessary code, work, and
 potentially unnecessary DB calls (when there are cache misses) — which is
 enough for a callback to do something with on their own terms. I would
 rather a plugin eat a few extra cycles exactly when they need it, versus
 core always calling code.

 I'd suggest wontfix.

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


More information about the wp-trac mailing list