Disable access to quiz pages / directory

Home Forums Legacy Support Support queries How-to & Troubleshooting Disable access to quiz pages / directory

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #40113
    externaluses
    Participant
    What's the best way to not allow users to navigate to example.org/quiz/ or a particular quiz, such as example.org/quiz/my-quiz-1 ? Currently the quizzes can only be taken inside of a course, so there is no need to go directly to it.
    #40307
    H.K. Latiyan
    Participant
    For this you can use this code in your wplms-customizer.php file present in your wplms customizer plugin. add_action('template_redirect','custom_redirect_single_quiz'); function custom_redirect_single_quiz(){   if(is_singular('quiz')){     wp_die('The Quiz cannot be accessed directly');   } } NOTE: Change the message "The Quiz cannot be accessed directly" according to your requirements.
    #41229
    externaluses
    Participant
    Marking as solved. Thanks.
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Disable access to quiz pages / directory’ is closed to new replies.