WordPress LMS for Web and mobile Forums Ionic App Support Hide some courses in app

Hide some courses in app

Tagged: ,

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

    Hilman Fajrian
    Participant
    Hi, I have some courses made by Visual Composer. Since VC shortcode not rendered (yet) in my app, I need to hide these courses in app. In directory, filtered category, and student course category. Need assist. Thanks.
    #18538

    admin
    Member
    Well this can be done but we need some identifier to identify the courses which are built on visual composer . Maybe you can assign a category to them .
    #18541

    Hilman Fajrian
    Participant
    Good idea. But how to hide courses from certain category in app? Another idea is using course ID as identifier. How to hide courses in app using course ID?
    #18584

    Scott Lang
    Keymaster
    you can use  this   add_filter('bp_course_api_get_featured_courses','unset_some_courses',9999,2);   add_filter('bp_course_api_get_courses','unset_some_courses',9999,2); function unset_some_courses($posts, $request ){ foreach ($posts as $key => $course) { $terms = get_the_terms($course->data['id'],'course-cat'); $cats = array(); foreach ($terms as $k => $term) { $cats[] = $term->term_id; } if(in_array(your_course_id, $cats)){   unset($posts[$key]); } } return $posts; }   put this code to your wplms-customizer.php file(customizer plugin)
    #19125

    Hilman Fajrian
    Participant
    @Scott Your code above does not work. The course I need to hide is still showing in app. The course ID is 2475. And this is my code. Need help to fix ---- add_filter(‘bp_course_api_get_featured_courses’,’unset_some_courses’,9999,2);       add_filter(‘bp_course_api_get_courses’,’unset_some_courses’,9999,2);   function unset_some_courses($posts, $request ){   foreach ($posts as $key => $course) {   $terms = get_the_terms($course->data[‘id’],’course-cat’);   $cats = array();   foreach ($terms as $k => $term) {   $cats[] = $term->term_id;   }   if(in_array(2475, $cats)){       unset($posts[$key]);   }   }   return $posts;   }
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

izmir escort

antalya escort

izmir escort

antalya escort

izmir escort

bursa escort

porno izle

porno izle

porno izle

escort istanbul

instagram ucuz takipçi satın al

takipçi hilesi

takipçi satın al

instagram takipçi hilesi

takipçi satın al

instagram takipçi hilesi

izmir escort

bornova escort bayan

buca escort bayan

karşıyaka escort bayan

çeşme escort bayan

takipçi satın al

instagram takipçi satın al

instagram takipçi satın al

sex hikayesi

smm panel

haberler

istanbul escort

instagram takipçi satın al

instagram takipçi satın al

instagram takipçi satın al

twitter takipçi

tiktok takipçi satın al