Automatically click mark complete and go to next unit on media complete

NOTE:  This tip will work only for wordpress videos. Please go to wp-admin -> wplms -> footer -> google analytics code. <script> jQuery( ‘body’ ).delegate( ‘#mark-complete’, ‘media_complete’, function(event){ jQuery(‘#mark-complete’).trigger(‘click’); setTimeout(function(){ jQuery(‘#next_unit’).trigger(‘click’); var esc = jQuery.Event(“keydown”, { keyCode: 27 }); jQuery(“body”).trigger(esc); },3000) }); </script>  

Show Error message for Non-logged in Users when they click on Take this course button

Please use this code in your wplms-customizer.php file in your wplms customizer plugin: add_filter(‘wplms_take_course_button_html’,’custom_non_loggedin_user_redirect’,10,2); function custom_non_loggedin_user_redirect($html,$course_id){ if(!is_user_logged_in()){ $message=get_permalink().’?error=login’; return ‘<a href=”‘.$message.'” class=”course_button full button”>’.apply_filters(‘wplms_take_this_course_button_label’,__(‘TAKE THIS COURSE’,’vibe’),$course_id).apply_filters(‘wplms_course_button_extra’,$extra,$course_id).'</a>’; } return $html; }  

Redirect Non-logged in Users to Register Page when they click on Take this course button

Please add this code in your wplms-customizer.php file present in your wplms customizer plugin (go to wp-admin->plugins->editor->select wplms customizer plugin and add the code in wplm-customizer.php file) OR add the code in the function.php file of your child theme (if using a child theme): add_filter(‘wplms_take_course_button_html’,’custom_non_loggedin_user_redirect’,10,2); add_filter(‘wplms_course_non_loggedin_user’,’custom_non_loggedin_user_redirect’,10,2); add_filter(‘wplms_private_course_button_html’,’custom_non_loggedin_user_redirect’,10,2); function custom_non_loggedin_user_redirect($html,$course_id){ if(!is_user_logged_in()){ […]

Add advanced search bar on homepage

Please  follow these steps: First make a custom sidebar from the wplms->sidebar manager.   Now this sidebar will appear in appearance->widgets: Now add buddypress course search widget in the sidebar. Make sure your location is enabled from the wplms->course manager->enable course manager.   Now go to home page in backend and […]

Redirect to My Account page after checkout

Please use this code in your wplms-customizer.php file in your wplms customizer plugin. add_action( ‘template_redirect’, ‘wc_custom_redirect_after_purchase’ ); function wc_custom_redirect_after_purchase() { global $wp; if ( is_checkout() && ! empty( $wp->query_vars[‘order-received’] ) ) { wp_redirect( get_permalink( get_option(‘woocommerce_myaccount_page_id’) ) ); exit; } }  

Show Certificates and Badges below Profile Details.

Please use this code in wp-admin->plugins->editor->wplms customizer plugin->wplms-customizer.php file. add_action(‘init’,’custom_hide_certificate_badge’); function custom_hide_certificate_badge(){ remove_action(‘bp_before_profile_content’,’wplms_show_profile_snapshot’); } add_action(‘bp_after_profile_content’,’wplms_show_profile_snapshot’); Result: 

Dashboard Sidebar for Custom Role

This tip is to make custom role in wplms and then register a custom sidebar for that user role only. Please follow these steps: Paste this code in the wplms-customizer.php file present in the wplms customizer plugin OR in the function.php file of your child theme. add_action(‘init’,’parent_sidebar’); function parent_sidebar(){ $papa_capability=array( […]

Change Instructing courses slug.

Please add this code in your wplms-customizer.php file present in your wplms customizer plugin. add_filter(‘wplms_instructing_courses_endpoint’,’custom_slug_for_instructing_courses’,9); function custom_slug_for_instructing_courses(){ return ‘custom_link’; } Please change the custom_link accordingly. Please do not forget to re-save permalinks after applying this code (it requires permalink structure to be re-saved).

Set Media upload limit for Instructors

This Tip is to limit the size of upload media for Non-Administrators. For example by using this tip you can restrict instructors to upload media file size in courses. Please paste this code in the wplms-customizer.php file present in your wplms customizer plugin.   /** * Filter the upload size […]