[wp-trac] [WordPress Trac] #55942: Add a "value type" parameter to get_option() and get_metadata()
WordPress Trac
noreply at wordpress.org
Wed May 10 19:49:11 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: needs-testing | Focuses: performance
--------------------------------+--------------------------
Changes (by flixos90):
* keywords: has-patch has-unit-tests needs-testing => needs-testing
Comment:
Removing these two keywords for now since any patch attached is still
preliminary based on all the still ongoing discussion on the high-level
approach.
Again, rather than continuing to discuss the low-level technical
implementation, I suggest we take a step back here and think about what we
want to achieve as part of this ticket. There are two concerns being mixed
up which have different implications, including on backward compatibility.
1. Avoiding calls to `maybe_unserialize()` is a performance related
effort.
2. Ensuring specific data types are returned from `get_option()` calls is
not performance related and more about developer experience, e.g. to avoid
having to type-cast every return value from that function.
I think those should be two different tickets which ''maybe'' are related,
but I think the discussion here is unnecessarily complicating the 1. goal
by combining it with the 2. goal, which wasn't the original point of this
ticket as far as I can tell.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55942#comment:79>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list