Remove draft courses from all courses page

Home Forums Legacy Support Support queries How-to & Troubleshooting Remove draft courses from all courses page

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #228168
    gsjaak_118
    Participant
    Hi! I would like to complete remove all the draft and pending courses from the all courses pages it is messes up the way alle the courses are shown to admin and instructors. How can i fix this, i tried modifying the code found on this page, but with no succes unfortunately: https://wplms.io/support/forums/topic/some-draft-courses-showing-some-not-on-all-courses-page-why/ Kind regards
    #228220
    logan
    Member

    Hello,

    Try adding the given code in your wplms-customizer.php file in wplms customizer plugin :

    add_filter('bp_course_wplms_filters','wplms_hide_draft_courses',99);

    function wplms_hide_draft_courses($query_args){

      if(!current_user_can('manage_options')){

          $query_args['post_status'] = array('publish');

      }

      return $query_args;

     }

    Please note that only admins will see the courses on the all courses page  if the above code added  .
    Also, you have to add the code at the end of the wplms-customizer.php file before " ?> " .
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Remove draft courses from all courses page’ is closed to new replies.