[wp-trac] [WordPress Trac] #55942: Add a "value type" parameter to get_option() and get_metadata()

WordPress Trac noreply at wordpress.org
Fri Apr 28 12:00:25 UTC 2023


#55942: Add a "value type" parameter to get_option() and get_metadata()
-------------------------------------------------+-------------------------
 Reporter:  azaozz                               |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  6.3
Component:  Options, Meta APIs                   |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests needs-      |     Focuses:
  testing                                        |  performance
-------------------------------------------------+-------------------------

Comment (by spacedmonkey):

 > Unfortunately both register_meta() and register_setting() are targeting
 only the REST API and aren't particularly useful outside of it. Both
 require a lot of data/code/settings that don't make sense in many cases.

 Register meta existing before the REST API and adding support for it was
 only added in 4.9.8. I think these functions were designed to do exactly
 this. They are currently used only for the REST API, but this another
 perfect use for them.

 The fact you can define a type for settings and meta and that currently is
 not respected outside of REST API, is a bug, IMO.

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


More information about the wp-trac mailing list