Created
November 18, 2024 10:25
-
-
Save nathan-roberts/95521ce11e47a3f6aeceb6f549d120b6 to your computer and use it in GitHub Desktop.
Revisions
-
nathan-roberts created this gist
Nov 18, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ <?php require_once('wp-load.php'); // Load the Action Scheduler library if (class_exists('ActionScheduler')) { $action_id = 11; $sql = "UPDATE `local`.`wp_actionscheduler_actions` SET `status` = 'pending' WHERE `action_id` = " . $action_id . ";"; $result = $wpdb->query($sql); // Get the action object by ID $action = \ActionScheduler::store()->fetch_action($action_id); var_dump($action); if ($action) { // Execute the action $action->execute(); echo "Action with ID $action_id has been executed."; } else { echo "Action with ID $action_id not found."; } } else { echo "Action Scheduler class not found."; }