[Resolved] learndash hooks and block elements

Home Forums Support [Resolved] learndash hooks and block elements

Home Forums Support learndash hooks and block elements

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1992922
    Carlo

    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

    #1993052
    Leo
    Staff
    Customer Support

    Hi there,

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

    #1993124
    Carlo

    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.

    #1993143
    Carlo

    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 ๐Ÿ˜‰

    #1993377
    Leo
    Staff
    Customer Support
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.