I am creating 2 different plugins for LearnDash ( One for Lesson , another for Topic ) in WordPress.
Here I have a requirement to use one LearnDash hook (ld_lesson_access_from
) in both the plugins.
When I activate any one plugin , this hook works fine. But when Both the plugins are activated , then hook with highest priority is running.
On course page , where Topics and Lessons are listed , I have requirement to activate both the plugins, .
//Plugin 1
add_filter( 'ld_lesson_access_from', array( __CLASS__, 'filter__ld_lesson_access_from_1' ), 999999, 3 );
public static function filter__ld_lesson_access_from_1( $access_from, $lesson_id, $user_id ) {
// code
}
//Plugin 2
add_filter( 'ld_lesson_access_from', array( __CLASS__, 'filter__ld_lesson_access_from_2' ), 99999, 3 );
public static function filter__ld_lesson_access_from_2( $access_from, $topic_id, $user_id ) {
// code
}
I want that both the hook should run. How do I do this ?
Or
Can we have the same filter for Topic ?