Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #61950, comment 2


Ignore:
Timestamp:
08/28/2024 11:24:30 PM (7 weeks ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #61950, comment 2

    v1 v2  
    99> I suggest that the DocBlock for those functions is updated to document this behavior explicitly
    1010
    11 Yea, don't think anything else can be done at this point. I actually tried to make options saving and retrieving to respect data types, but at the end there were too many edge cases that it became risky and not practical.
     11Yea, don't think anything else can be done at this point. I actually tried to make options saving and retrieving to respect data types, see #55942. But at the end it had to be scaled down because of back-compat, and there were many edge cases that made it not practical.
    1212
    1313A good docblock update for the different meta retrieval functions (post, comment, user, site, etc.) would include the full description about what's going on, and probably mention that the unexpected types can be avoided at the cost of a tiny bit more processing if the data is serialized. JSON encoding would also work in most cases, but may behave a bit unexpectedly when differentiating between objects and associative arrays.