/** * Handle the Admin AJAX request to process the queue */ public static function admin_ajax_process_queue() { include_once 'Pods_Jobs_Queue_API.php'; // Check if request uses API key, and if incorrect, don't serve request if (isset($_REQUEST['pods_jobs_queue_api_key'])) { if (!defined('PODS_JOBS_QUEUE_API_KEY') || PODS_JOBS_QUEUE_API_KEY != $_REQUEST['pods_jobs_queue_api_key']) { die; } } elseif (!is_user_logged_in() || !pods_is_admin('pods', 'pods_jobs_queue')) { die; } Pods_Jobs_Queue_API::run_queue(); // AJAX must die die; }
/** * Deactivate plugin routine */ public static function deactivate() { include_once 'Pods_Jobs_Queue_API.php'; Pods_Jobs_Queue_API::uninstall(); }
/** * Queue job to be ran by Pods Jobs Queue * * @param array $data * * @return int|bool The new Job ID if it was added, otherwise false */ function pods_queue_job(array $data) { include_once 'Pods_Jobs_Queue_API.php'; return Pods_Jobs_Queue_API::queue_job($data); }