Disable the privacy for particular post type

Please add the given code in your wp-content/plugin/wplms-customizer/wplms-customizer.php .

This will disable the privacy for questions only :

add_filter('init','remove_wplms_frontend_cpt_query');
function remove_wplms_frontend_cpt_query(){
    add_filter('wplms_frontend_cpt_query','wplms_instructor_privacy_filter_remove_questions',999);
    add_filter('wplms_backend_cpt_query','wplms_instructor_privacy_filter_remove_questions',999);
}
function wplms_instructor_privacy_filter_remove_questions($args){
    if($args['post_type'] == 'question'){
        unset($args['author']);
    }
    return $args;
}

Note : You can replace the custom post type “question” with the following :
course, wplms-assignment,quiz,unit,certificate to disable the privacy for particular post type

Was this article helpful?

Related Articles

Leave A Comment?