register(); ( new AlpineConsent_Blocker() )->register(); ( new AlpineConsent_Admin( $alpineconsent_banner_settings, $alpineconsent_general_settings ) )->register(); ( new AlpineConsent_Setup_Wizard() )->register(); // Must be called directly from this, the main plugin file — WordPress // only ever recognizes register_activation_hook() from here, not from // a required include (see AlpineConsent_Setup_Wizard::handle_activation()'s // own docblock for what this flag actually triggers). register_activation_hook( ALPINECONSENT_PLUGIN_FILE, array( 'AlpineConsent_Setup_Wizard', 'handle_activation' ) ); // Front-end too — the [alpineconsent_cookie_policy], // [alpineconsent_legal_notice] and [alpineconsent_privacy_cookies_section] // shortcodes have to render for visitors, not just in wp-admin. AlpineConsent_Policy_Page::register(); AlpineConsent_Legal_Notice_Page::register(); AlpineConsent_Privacy_Section::register(); // Its own register() already checks is_admin() internally (only 2 real // admin-post.php handlers to add) — same pattern as the 3 calls above. AlpineConsent_Legal_Content_Overrides::register(); $alpineconsent_banner_settings->register(); $alpineconsent_general_settings->register(); // The Connect flow's own admin-post.php handlers only ever fire in // wp-admin — registering them on every front-end page load would be // pure overhead. (The self-hosted update checker that used to be // registered here, AlpineConsent_Updater, was retired once this plugin // went live on WordPress.org — see readme.txt's own history: WordPress // core already checks wordpress.org directly for this plugin's slug, // so a second, self-hosted update channel is now both redundant and a // guideline risk for a WordPress.org-hosted plugin.) if ( is_admin() ) { ( new AlpineConsent_Connection() )->register(); // wp_ajax_* handlers run under is_admin() too (admin-ajax.php lives // in wp-admin regardless of who's calling it) — same reasoning as // the two calls above. ( new AlpineConsent_AI_Translation() )->register(); ( new AlpineConsent_Legal_Backup() )->register(); }