Home › Forums › Legacy Support › Support queries › Other issues › Every time I update this course-page Reviews disappear II
- This topic has 2 replies, 2 voices, and was last updated 4 years, 4 months ago by Steve.
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
December 6, 2019 at 5:05 pm #236071carlosmerSpectatorI added II to the title of this post because I already had this problem before and it was fixed thanks to a particular code provided by MK: https://wplms.io/support/forums/topic/every-time-i-update-this-course-page-reviews-disappear/ Please read that post to understand what exactly is my problem. The code provided by MK worked really well but then I had another completely different Issue which was: UNITS ARE PUBLIC IN PRIVATE LESSONS You can read about my other problem here: https://wplms.io/support/forums/topic/units-are-public-in-private-courses/ Although this time Mk did not really understand my problem, I talk to Mr Vibe and he kindly provided me with this code which fixed this second issue: if(class_exists('WPLMS_Customizer_Plugin_Class')) { // instantiate the plugin class $wplms_customizer = new WPLMS_Customizer_Plugin_Class(); } // units private add_action('template_redirect','merpixel_vibe_check_access_check',1); function merpixel_vibe_check_access_check(){ if(!is_singular(array('unit','question')) || !function_exists('vibe_validate')) return; $flag=0; global $post; $free=get_post_meta(get_the_ID(),'vibe_free',true); if(vibe_validate($free) || (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && is_user_logged_in())){ $flag=0; return; }else $flag = 1; if(current_user_can('edit_posts')){ $flag=0; $instructor_privacy = vibe_get_option('instructor_content_privacy'); $user_id=get_current_user_id(); if(isset($instructor_privacy) && $instructor_privacy && !current_user_can('manage_options')){ if($user_id != $post->post_author) $flag=1; } } if($post->post_type == 'unit'){ $post_type = __('UNITS','vibe'); }else if($post->post_type == 'question'){ $post_type = __('QUESTIONS','vibe'); } $message = sprintf(__('DIRECT ACCESS TO %s IS NOT ALLOWED','vibe'),$post_type); $flag = apply_filters('wplms_direct_access_to'.$post->post_type,$flag,$post); if($flag){ wp_die($message,$message,array('back_link'=>true)); } }
The problem is this new code was not compatible with the code to fix the first problem. And as the second problem was more important I just deleted the first code so now I have again the same first problem. Please I need to fix the first problem in some way that is compatible with the fix of the second problem. Could you please check it? Thank you very muchDecember 7, 2019 at 5:02 pm #236173carlosmerSpectatorI am sorry, I think I was adding the codes wrong, I have tried again and both of them worked. It's fixed now Thank you very much for your support.December 9, 2019 at 5:27 am #236238SteveMemberThanks for confirming. I hope you wouldn't mind writing a detailed review about your experience with WPLMS and our customer support. Here: https://themeforest.net/item/wplms-learning-management-system/reviews/6780226 If I can be of assistance, please do not hesitate to contact me again. Closing this topic. Thanks and Regards -
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- The topic ‘Every time I update this course-page Reviews disappear II’ is closed to new replies.