Make it possible to disable plugin from theme?
-
When developing locally I would like to use PHP’s native error handler instead of Bugsnag’s, but still have the same code base/database for my local and live server (and not being forced to manually deactivate the plugin for different servers).
ATM it’s impossible to override with the
bugsnag_set_error_and_exception_handlers
filter from within functions.php (since it’s applied directly when the plugin loads (which is before the theme)). Would it be possible to runconstructBugsnag()
in theinit
hook or similar, and not directly when the plugin is loaded? That way I could disable bugsnag’s error handlers depending on my debug environment variable from within the theme’s function.php.I also tried running
restore_error_handler();
, but that results in this warning:strpos(): Empty needle in plugins\bugsnag\bugsnag-php\Error.php on line 386
- The topic ‘Make it possible to disable plugin from theme?’ is closed to new replies.