-
Notifications
You must be signed in to change notification settings - Fork 18
Action and Filter Recommendations #63
Comments
Thanx for the issue @ronalfy. The proposed new action makes sense (and I suppose we'd also want a similar one for themes, right?). As for the proposed new filter (again, we'd want the same for themes, right?), can you explain how it would be any different than using core's existing site_option_{$option}? That is, how would hooking into your proposed |
Good point @pbiron. I guess it would make it more explicit. I always found it a bit hacky IMO to hook into filters (options) that way, but if that's the preferred approach, we can skip it. |
I figured that was your thinking. I'm not against the idea, that was just my initial thought upon reading the issue for the first time. Of course, having a separate filter provides a level of abstraction, so that plugin authors don't need to know that the plugins/themes that will auto-update is stored in a site option. So, there might be some benefit to the additional filter. Be sure to raise this question during the next meeting (in case I forget). |
Are there any other places in core where we have these more explicit actions? I agree with @pbiron that I think using core's existing filters and options makes sense. |
One came to mind, although it's not quite the same. It has to do with whether the admin bar shows on the front-end. In that case, there is a call to So, the |
Interesting find. I think part of the reasoning for that is because of the Another example could be the There are also the filters for Searching through the code base for For the actions, I think a similar example would be the I think a similar logic applies here. If a 3rd party wants to maintain a copy of the list of plugins with auto-updates enabled in a separate location, using the pre hook here wouldn't be safe, since any direct modifications to the option wouldn't be tracked. So from my perspective, I think adding the action would make sense if we wanted to provide a way for plugin authors to save additional custom data when the auto update list is updated. With the current UI, save is triggered by a link, I don't see how plugin authors would be able to meaningfully hook in there. For filters, I think if we meaningfully transformed the values, or were able to provide some additional context about how the list of auto updates were being used, and it would make sense for a plugin to alter results based on that context, then adding filters on the return value would make more sense to me. Just my 2 cents though. |
As in the ancient curse:
Exactly. I bumped into that example recently while trying to figure why the admin bar was showing when it shouldn't, even tho I'd hooked into both |
Thinking that for the stated purpose, the Not sure if new/more specific filters are needed. |
This is a proposal for actions and filters that can be included in the auto-update featured plugin.
The goal is to allow third-party update manager plugins to still be able to offer services and compatibility with the featured plugin.
Filter when retrieving an option.
Goal: Allow third-party update manager plugins to reflect correctly in the plugin/theme area which plugins are under auto-update.
Example:
Action Before Saving Option
Goal: Allow third-parties to update their own plugin/theme list of updated plugins/themes.
Example:
I'm sure there will be more filters/actions as testing continues, but these basics should help third-parties.
The text was updated successfully, but these errors were encountered: