You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.
it is a little bit more friendly for other developers if you do
$editor_experiments = newEditor_Experiments();
Doing so makes it easy for another plugin author to remove your action/filter and add their own variation should they want to adjust the behavior a bit.
The text was updated successfully, but these errors were encountered:
The singleton approach might be a little cleaner. The drawback of singletons is that they are harder to write unit tests against, but they do avoid adding any additional global variables.
If you go with the singleton, I think the following makes sense:
Looking through the actions and filters you're adding, I am not sure when a developer might want to do something like that, but it is a good practice to provide a way for other developers to remove hooks you're adding.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Rather than
it is a little bit more friendly for other developers if you do
Doing so makes it easy for another plugin author to remove your action/filter and add their own variation should they want to adjust the behavior a bit.
The text was updated successfully, but these errors were encountered: