I use LearnDash plugin for e-learning courses.
I am using the learndash hook for when a topic is completed to run some code. This looks a bit like this:
add_action(“learndash_topic_completed”, “ld_award_topic_points”, 5, 1);
The ld_award_topic_points function has some PHP running some queries against the database that works great. However, any echoing of HTML doesn’t work at all.
This action runs when a user completes a quiz successfully. It doesn’t refresh the page when running it. But as mentioned the PHP is running so the function is triggering without the refresh.
This is probably basic and obvious that this doesn’t work. I was hoping someone might be able to explain why and if there is a way around this?
Read more here:: Echo HTML in Hook Doesn’t Work