Need data from two different actions

Try $globalres=””; add_action(‘quiz_completed’, ‘mi_ld_quiz_ert’, 10, 2); function mi_ld_quiz_ert( $quizdata, $current_user ) { global $globalres; if($globalres== 0){ do_action(‘ld_update_group_access’, $current_user, 2, $remove = false )); } else{ do_action(‘ld_update_group_access’, $current_user, 14, $remove = false )); } } add_action(‘learndash_ques_single_answer_correct’, ‘my_ld_quiz_resp’,5,5); function my_ld_quiz_resp( $answerIndex, $correctAnswer, $userResponse) { global $globalres; $globalres = $answerIndex; }

Submit to itself don’t work

$formtxt .= ‘<form style=”width: 800px;” name=”time_booking” action=”#” onsubmit=”return validateCalendarForm();” method = “POST”>’; action is set to #. maybe that is the cause. try removing that. action=”” additionally a js function validateCalendarForm() is calling on form submit. so check console for errors too. and lastly refresh permalink structure

Can add_image_size be added earlier

You can set the priority to 999 to make sure if you are going that way: add_action( ‘after_setup_theme’, ‘_my_action_add_image_sizes’, 999 ); but if you really want to make sure of that order, try making a custom action, here a small example: /** * Execute the action with do_action. */ function read_theme_options() { //all the logic … Read more

Can I run a slow action in a seperate thread?

Techcrunch has released a library to spawn an asynchronous task within WordPress. https://github.com/techcrunch/wp-async-task Essentially, you can take any process that is triggered by an action hook, and you can defer the processing on that hook to run asynchronously. You extend the class to define which action you are triggering and a couple of functions to … Read more