Closed szepeviktor closed 1 year ago
@szepeviktor this breaks admin.php
I'm sorry. What is the error?
I see. The REST class and the CLI class instantiate new WPSweep()
without the plugin main file's path.
Should I replace those new
-s with WPSweep::get_instance()
?
https://wordpress.org/support/topic/fatal-error-in-the-wp-sweep-version-1-1-6/
I make the arguments optional and it works =)
Not sure is there a better way of not passing in FILE to the class.
I think WPSweep
should be instantiated (new WPSweep()
) only once in the get_instance
method.
Multiple instantiations cause really bad side-effects. For example multiple hooking.
Not sure is there a better way of not passing in
__FILE__
to the class.
Please do not tell anyone about it. I will deny it.
Put __FILE__
into a global constant.
define( 'WP_SWEEP_MAIN_FILE', __FILE__ );
@szepeviktor LOL I let you figure it out and send a PR to change to new WPSweep()
But the reason I use a singleton is that I need to access the functions outside.
@lesterchan 👋🏻