[wp-trac] [WordPress Trac] #38323: Reconsider $object_subtype handling in `register_meta()`

WordPress Trac noreply at wordpress.org
Mon Nov 13 01:36:57 UTC 2017


#38323: Reconsider $object_subtype handling in `register_meta()`
-------------------------------------------------+-------------------------
 Reporter:  flixos90                             |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  5.0
Component:  Options, Meta APIs                   |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-unit-tests 2nd-      |     Focuses:  rest-api
  opinion                                        |
-------------------------------------------------+-------------------------

Comment (by flixos90):

 Another idea: For ease of use, we might wanna introduce functions specific
 to object types, that could be used whenever someone wants to register
 data for a subtype. Such as:

 * `register_post_meta( $post_type, $meta_key, $args )`
 * `register_term_meta( $taxonomy, $meta_key, $args )`

 These would be much more intuitive to use, particularly because of clarity
 in naming (everybody knows what `$post_type` and `$taxonomy` mean,
 opposite of the new term "subtype"). They could simply wrap
 `register_meta()` though, passing the `$post_type` / `$taxonomy` as
 subtype in the arguments array of it.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38323#comment:37>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list