/** * Registers the plugin and saved the context in which * the plugin will run. */ public function addFilters() { register_activation_hook(Strata::config('runtime.polyglot.loaderPath'), function () { $query = new Query(); $query->createTable(); }); $polyglot = new Polyglot(); // We need to rehook into setCurrentLocaleByContext because we need to // try again once global post objects are loaded. add_action(is_admin() ? 'admin_init' : 'wp', array($polyglot, "setCurrentLocaleByContext"), 3); is_admin() ? AdminAdaptor::addFilters() : FrontAdaptor::addFilters(); CommonAdaptor::addFilters(); WidgetAdaptor::addFilters(); }