[wp-trac] [WordPress Trac] #35658: Provide additional data for registered meta through register_meta()

WordPress Trac noreply at wordpress.org
Sun Jul 17 18:26:01 UTC 2016


#35658: Provide additional data for registered meta through register_meta()
-------------------------------------------------+-------------------------
 Reporter:  jeremyfelt                           |       Owner:  helen
     Type:  task (blessed)                       |      Status:  accepted
 Priority:  high                                 |   Milestone:  4.6
Component:  Options, Meta APIs                   |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  needs-unit-tests needs-testing has-  |     Focuses:
  patch rest-api needs-dev-note                  |
-------------------------------------------------+-------------------------

Comment (by ocean90):

 Nice work in [attachment:35658.48.diff]. `register_meta()` still has a
 comment which references "subtype" (''Global registry only contains meta
 keys registered in the new way with a subtype.'') and
 `Tests_Meta_Register_Meta::test_register_meta_with_valid_object_type_and_object_subtype_returns_true`
 should probably be renamed.

 Do we want to add support for "some sort of `WP_Object_Type`" now? We'd
 only have to cast the `$object_type` to a string:

 {{{#!php
 <?php
 class Foo {
         function __toString() {
                 return 'foo:bar';
         }
 }

 $foo = new Foo();
 $a[ $foo ] = 'a'; // Illegal offset type
 $a[ (string) $foo ] = 'b'; // array(1) { ["foo:bar"]=> string(1) "b" }
 }}}

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


More information about the wp-trac mailing list