New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using $plugin_name during activation #281
Comments
Good question that I don't have a good answer for unfortunately. I've been looking at the activator and deactivator classes myself today and am going to go look through any discussions that have taken place about them. If you have any thoughts, feel free to share. |
As quick follow up: #178 |
Thanks for the reply Devin. Interesting. Since the (de)activation classes are static there's really no way of passing $plugin_name and $version to them unless of course these two variables are also made static, right? So one way could be including the main plugin class before the (de)activator classes in (de)activate_plugin_name() and making these variables static. I've been looking at a bunch of plugins (WC, EDD, Ninja Forms, WP SEO etc.) and they all seem to be using constants. That could be another possibility. |
@EmilEriksen also need some $plugin_name in the activator class, but can't because of non static. So i used constant, but don't like it. Did you find another solution ? Thanks |
I am turning the main class to a singleton for this. |
I use Closure in my fork. |
Every time I've made a plugin I've found myself needing the plugin name slug in the activator class (for instance to prefix options). Why is it that this is not made available in the activator (or deactivator) class?
The text was updated successfully, but these errors were encountered: