skip to Main Content

I am developing a theme and that’s why need to remove these two hooks. How to remove them?

add_action(
    'learn-press/before-courses-loop-item',
    LP()->template( 'course' )->text( '<div class="course-wrap-thumbnail">', 'course-wrap-thumbnail-open' ),
    1
);
add_action(
    'learn-press/before-courses-loop-item',
    LP()->template( 'course' )->callback( 'loop/course/badge-featured' ),
    5
);

2

Answers


  1. Chosen as BEST ANSWER

    After struggling a certain period of time I have checked the LearnPress plugin's core files and found the solution in commented code.

        'learn-press/before-courses-loop-item',
        LP()->template( 'course' )->text( '<div class="course-wrap-thumbnail">', 'course-wrap-thumbnail-open' ),
        1
    );
    
    LP()->template( 'course' )->remove( 'learn-press/before-courses-loop-item', array( '<div class="course-wrap-thumbnail">', 'course-wrap-thumbnail-open' ), 10 );
    
    add_action(
        'learn-press/before-courses-loop-item',
        LP()->template( 'course' )->callback( 'loop/course/badge-featured' ),
        5
    );
    
    LP()->template( 'course' )->remove_callback( 'learn-press/before-courses-loop-item', 'loop/course/badge-featured', 5 );```
    
    Each hook needs to remove by this way. It is working fine with my theme now. Thanks all of you who gave answers here.
    

  2. Remove actions with the remove_action hook

    remove_action( 'learn-press/before-courses-loop-item' , 'loop/course/badge-featured', 28);

    Or…

    remove_action( 'learn-press/before-courses-loop-item', LP()->template( 'course' )->callback( 'loop/course/badge-featured' ), 10 );

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search