/** * Handle admin tasks for cart66 */ function cc_task_dispatcher() { $task = cc_get('cc-task', 'key'); // CC_Log::write( "Task dispatcher found: $task" ); if ($task) { switch ($task) { case 'dismiss_notification_theme_support': CC_Admin_Notifications::dismiss('cart66_theme_support'); break; case 'dismiss_notification_permalinks': CC_Admin_Notifications::dismiss('cart66_permalinks'); break; case 'dismiss_notification_migration': CC_Admin_Notifications::dismiss('cart66_migration'); break; case 'download_log': CC_Log::download(); break; case 'reset_log': CC_Log::reset(); break; case 'test_remote_calls': $tests = new CC_Cloud_Remote_Check(); $tests->run(); break; case 'create_slurp_page': CC_Page_Slurp::create_slurp_page(); break; case 'migrate_settings': $migration = new CC_Migration(); $migration->run(); break; } } }
/** Cart66 Cloud activation process **/ function cc_activate() { CC_Log::write('Cart66 Cloud has been activated.'); // Add Cart66 endpoints and routes CC_Routes::add_routes(); // Register product post type on activation include_once CC_PATH . 'includes/cc-product-post-type.php'; cc_register_product_post_type(); // Flush rewrite rules after adding new routes add_action('shutdown', 'cc_flush_rewrite_rules'); // Attempt to create page slurp template during plugin activation CC_Page_Slurp::create_slurp_page(); }