inject_settings(); // The gate is only useful if it can be found. This prompt lives outside // the settings page precisely because the sites that leak hardest are // the ones whose administrator never opens it. ActivationNotice::boot(); // The engine's own built-in task. Registered through the same public seam // every other contributor uses — the registry has no privileged list. add_action( TaskRegistry::COLLECT_ACTION, static function ( TaskRegistry $registry ) { $registry->register_classes( [ TransientsTask::class ] ); } ); } /** * Tell the SPA this module booted. * * A field on the EXISTING localized settings object, not a new window * carrier — constitution XIII permits exactly two of those, and this is * injected data rather than a first-party runtime singleton. The JS entry * self-gates on it, so the tab is inert wherever the module did not boot. */ private function inject_settings(): void { add_filter( 'templately_admin_localized_data', static function ( $data ) { if ( ! is_array( $data ) ) { return $data; } $data['utilities'] = [ 'canManage' => current_user_can( 'manage_options' ), ]; return $data; } ); } /** * Routes are registered from here — `rest_api_init` — never the constructor. * `register_rest_route()` silently drops a route registered on * `plugins_loaded` with a `_doing_it_wrong` notice. */ public function register_rest_routes(): void { UtilitiesController::get_instance()->register_routes(); } }