[wp-trac] [WordPress Trac] #51296: Return result of set_theme_mod
WordPress Trac
noreply at wordpress.org
Mon Oct 19 22:50:35 UTC 2020
#51296: Return result of set_theme_mod
-------------------------+-----------------------------
Reporter: latifi | Owner: SergeyBiryukov
Type: enhancement | Status: closed
Priority: normal | Milestone: 5.6
Component: Themes | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch | Focuses:
-------------------------+-----------------------------
Comment (by SergeyBiryukov):
Replying to [comment:3 Hareesh Pillai]:
> I have refreshed the patch in
[https://core.trac.wordpress.org/attachment/ticket/51296/51296.diff
51296.diff]. Also updated `@return` in the doc block.
Thanks for the refresh!
> Should we also update the `remove_theme_mod` function?
Just noting that this seemed like a good idea, but turned out a bit more
complicated, as there are a couple of scenarios where it returns `null`:
* If the theme mod was not set.
* If if it was the last remaining theme mod for the theme.
So adding a return value to `remove_theme_mod()` could be explored in a
new ticket if someone feels strongly about it :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51296#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list