[wp-trac] [WordPress Trac] #53811: Rename `retrieve_widgets` to `recover_lost_widgets`
WordPress Trac
noreply at wordpress.org
Wed Jul 28 13:36:59 UTC 2021
#53811: Rename `retrieve_widgets` to `recover_lost_widgets`
-------------------------------------------------+-------------------------
Reporter: zieladam | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
| Review
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests 2nd- | Focuses:
opinion |
-------------------------------------------------+-------------------------
Comment (by zieladam):
> Then the retrieve_widgets function would be more of a task runner by
invoking more specific granular tasks that are encapsulated in separate
functions.
@hellofromTonya Encapsulation would surely be nice here. +1 for doing with
it regardless of this issue.
This issue is about the fact that the word `retrieve` suggest a read-only
operation in place where we actually do a ton of writes.
> The retrieve_widgets function does more than retrieve hidden or lost
widgets. In essence, it is rebuilding the global $sidebars_widgets by:
It is quite a complex function indeed. I don't think we can come up with a
name that would accurately reflect all it does. The second best thing is
making it clear that it fundamentally is a write-oriented function.
As a side note, I don't fully understand why do we need to run it before
reading data instead of bundling it with writes and theme changes.
Intuitively, I would expect write operations to clean up after themselves.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53811#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list