WordPress LMS for Web and mobile Forums WPLMS Student App Disable courses in app only

Disable courses in app only

Back to course
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #11816

    frankdage
    Participant

    Hello how do I go about making courses only available on the web app but not in the mobile app and vice versa please thanks.

    #11839

    Alex
    Keymaster

    Please confirm if you want some courses to be available on website but not in mobile app??

    if yes then please try adding this code in your wplms-customizer.php file in wplms customizer plugin :

     

    add_filter( ‘bp_course_api_get_featured_courses’, ‘custom_courses’ ,10,2);

    add_filter( ‘bp_course_api_get_courses’,’custom_courses’ ,10,2);

    function custom_courses($posts, $request ){

      $arr = array(115,118,119,116);

      foreach ($posts as $key => $data) {

        if(in_array($data[‘course’][‘id’],$arr)){

          unset($posts[$key]);

        }

      }

      return $posts;

    }

     

     

    in this line define your course ids separated by commas  :

    $arr = array(115,118,119,116);

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.