nsc_bar_execute_backend_wp_actions(); add_filter("plugin_action_links_" . plugin_basename(__FILE__), array($nsc_bar_admin_settings, 'nsc_bar_add_settings_link')); // frontend actions $nsc_bar_cookie_handler = new nsc_bar_cookie_handler; add_action('admin_init', array($nsc_bar_cookie_handler, 'nsc_bar_delete_cookie_for_preview'), 20); add_action('send_headers', array($nsc_bar_cookie_handler, 'nsc_bar_migrate_cookie_detailed_to_savesettings'), 1); add_action('send_headers', array($nsc_bar_cookie_handler, 'nsc_bar_cookie_cleanup'), 2); add_action('send_headers', array($nsc_bar_cookie_handler, 'nsc_bar_set_itp_cookie'), 5); add_action('send_headers', array($nsc_bar_cookie_handler, 'nsc_bar_set_default_cookies'), 10); // dataLayer needs to be pushed so early $nsc_bar_frontend_banner = new nsc_bar_frontend(); add_action("wp_loaded", array($nsc_bar_frontend_banner, "nsc_bar_enqueue_dataLayer_init_script")); // this is so late for the wp filter for the message and for weglot needed and possible other plugins. function nsc_bar_do_frontend_actions() { if (is_admin()) { return false; } $nsc_bar_plugin_configs = new nsc_bar_plugin_configs; $banner_active = $nsc_bar_plugin_configs->nsc_bar_get_option('activate_banner'); $banner_active = apply_filters('nsc_bar_filter_banner_is_active', $banner_active); if ($banner_active == true) { $nsc_bar_banner_config = new nsc_bar_banner_configs(); $nsc_bar_frontend_banner = new nsc_bar_frontend(); $nsc_bar_frontend_banner->nsc_bar_set_json_configs($nsc_bar_banner_config); $nsc_bar_frontend_banner->nsc_bar_execute_frontend_wp_actions(); } } add_action("plugins_loaded", "nsc_bar_do_frontend_actions");