<?php

global $backpack;

$taskID = (int) $_GET['run'];

if ($backpack->runTaskNow($taskID)) {
    echo '<script>window.location.href = "' . add_query_arg('hasrun', $taskID, remove_query_arg('run')) . '";</script>';
    echo '<div class="notice notice-success is-dismissible"><p>Task scheduled to run now.</p></div>';
}
