Schedule multiple instances of add_action at the same time.
-
Oddly, I can’t update my original thread so I’ve created this one to update my quest to use action hooks. This seemed easy enough looking up wp_schedule_single_event. The reason I want multiple instances is that the $args I pass in along with the action hook are different and may be required to run at the same scheduled time. However, every time I schedule the add hook at the same time with different arguments only the first one is run.
In the following code I trigger this just to test it with two different variables. Only $event_array is run not $event_array2.
$action_name = 'Hum'.'8'; $action_name2 = 'Hum'.'4'; $event_array = array('8',$action_name); $event_array2 = array('4',$action_name2); wp_schedule_single_event($timed4, 'Hope', $event_array); wp_schedule_single_event($timed4, 'Hope', $event_array2);
I cannot define multiple add_actions as each one needs to be called per user that will have a unique number (their user ID’s). Please, I would appreciate any help on how I can use this add_action hook per user and have them run in worse case scenario at the same time. If you require further information please let me know in a post. Thank you.
- The topic ‘Schedule multiple instances of add_action at the same time.’ is closed to new replies.