insights()->init(); // Include required files require_once WPWAND_PLUGIN_DIR . 'inc/config.php'; require_once WPWAND_PLUGIN_DIR . 'inc/editor.php'; require_once WPWAND_PLUGIN_DIR . 'inc/admin.php'; require_once WPWAND_PLUGIN_DIR . 'inc/data.php'; require_once WPWAND_PLUGIN_DIR . 'inc/helper-functions.php'; require_once WPWAND_PLUGIN_DIR . 'inc/frontend.php'; require_once WPWAND_PLUGIN_DIR . 'inc/api.php'; require_once WPWAND_PLUGIN_DIR . 'inc/WooCommerce.php'; if (!function_exists('wpwand_pro_init')) { require_once WPWAND_PLUGIN_DIR . 'inc/post-generator.php'; } $is_agency = wpwand_get_option('wpwand_pro_tala_agency'); if (!$is_agency) { require_once WPWAND_PLUGIN_DIR . 'inc/white-label.php'; } require_once WPWAND_PLUGIN_DIR . 'inc/gutenberg.php'; if (defined('ELEMENTOR_VERSION')) { require_once WPWAND_PLUGIN_DIR . 'inc/modules/elementor/wp-wand-elementor.php'; WDELMTR_Extension::instance(); } do_action('wpwand_init'); } add_action('init', 'wpwand_init', 10); /** * Load plugin textdomain. */ function wpwand_load_plugin_textdomain() { load_plugin_textdomain('wpwand', false, dirname(plugin_basename(__FILE__)) . '/languages/'); } add_action('plugins_loaded', 'wpwand_load_plugin_textdomain'); // Hook into the 'admin_init' action add_action('admin_init', 'wpwand_activation_redirect'); // Activation redirect function function wpwand_activation_redirect() { if (get_option('wpwand_activation_redirect', false)) { // Redirect to a specific page or URL after activation delete_option('wpwand_activation_redirect'); wp_safe_redirect(admin_url('admin.php?page=wpwand&welcome_screen')); exit; } } // Hook into the 'activated_plugin' action add_action('activated_plugin', 'wpwand_set_activation_redirect'); // Set activation redirect flag function wpwand_set_activation_redirect($plugin) { if ($plugin === plugin_basename(__FILE__)) { // Set the option to redirect after activation update_option('wpwand_activation_redirect', true); } }