Site logo

Archived topic

learndash hooks and block elements

4 replies · Started by Carlo on November 5, 2021

Viewing posts 1–5 of 5

Hi there,

I am trying to create a GP element in order to show a block on leardash courses / lessons but without success so far.

I have asked learndash support for the right hooks to call and they said that (for example), this should fire after the lessons title:

( https://developers.learndash.com/hook/learndash-lesson-row-expand-after/ )
learndash-lesson-row-expand-after

I have tried to with a simple block element made of a singole word in a text paragraph -> Element type Hook -> Hook Name: Custom hook -> custom hook name learndash-lesson-row-expand-after

Location: Lesson -> all lessons
Course -> all courses

But the element is not showing up.

Has anyone already succesfully created GP elements and used with learndash? Any tip?

Thank you. Carlo

Hi there,

Does it work if you use the function method shown in their example?

Hi Leo,

thanks for your reply.

I have just tried with:
learndash-course-after

here's my test:


			add_action(
				'learndash-course-after',
				function( $lesson_id, $course_id, $user_id ) {
					// May add any custom logic using $lesson_id, $course_id, $user_id
					echo '<span>Custom content or markup</span>';
				},
				10,
				3
			);

And it works.
But if I try with a gp element -> block -> custom hook -> learndash-course-after

It does not works.

UPDATE:
I have tried to do everything from scratch and with the aid of Simply Show hooks plugin.

Now it works. Thank you Leo for your support ;)

No problem :)

This archived topic is closed to new replies.