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

WordPress Trac noreply at wordpress.org
Mon May 14 11:28:03 UTC 2018


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

Comment (by johnjamesjacoby):

 I don’t need a re-explanation of the concepts being proposed; it’s in the
 ticket, and I understand what you’re hoping to do and why.

 It is not a good idea to reuse terms. Types and subtypes are being specced
 out as names for things that have nothing to do with actual types or
 subtypes, which have been part of all programming languages for longer
 than we’ve been alive to use them.

 Code in WordPress shouldn’t be confusing on purpose because it’s easy, and
 it definitely shouldn’t get more confusing because it’s already kinda
 confusing.

 After adding clarity to multisite-specific code, why lobby for confusing
 code here? And I disagree that making this feature more useful will take
 more time. Parsing array arguments isn’t any harder than comparing
 strings.

 Here’s one link to one PHP developer talking about types and subtypes
 without thinking of WordPress: https://www.stitcher.io/blog/what-php-can-
 be

 The only way to fully move forward with the types and subtypes literally
 being talked about here is to invent a base `WP_Type` and `WP_Sub_Type`
 class that define what registered types and subtypes are, so taxonomies
 and post types and such can be connected to them.

 Guessing at what core object types are, and not letting plugins declare
 their own object types and subtypes, leaves this fragile and unfinished.
 Just squatting a slug and hoping nothing collides was necessary ten years
 ago, and everyone has worked hard to code away from that idea.

 Not to mention that these aren’t taxonomy subtypes, these are term
 subtypes. Terms are already a subtype of their taxonomy.

 Types and subtypes are not good names for what’s being recommended here,
 unless we fill in all of the other gaps I mentioned above.

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


More information about the wp-trac mailing list