This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_shortcode('wplms_quiz_top_scorers',function($atts,$content = null){ | |
extract(shortcode_atts(array( | |
'count' => 5, | |
))); | |
global $wpdb; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('wp_footer',function(){ | |
if(!is_user_logged_in()) | |
return; | |
$user_id = get_current_user_id(); | |
$courses = bp_course_get_user_courses($user_id); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('wplms_course_retake_count',function($retakes,$course_id,$user_id){ | |
$status = bp_course_get_user_course_status($user_id,$course_id); | |
if($status > 3){ | |
$course_percentage = get_post_meta( $course_id,$user_id,true); | |
if($course_percentage >=85){ | |
return 0; | |
} | |
} | |
return $retakes; | |
},10,3); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'authenticate',function($user, $username, $password ) { | |
if(isset($user->allcaps['edit_posts']) && $user->allcaps['edit_posts']){ | |
return $user; | |
} | |
$sessions = WP_Session_Tokens::get_instance( $user->ID ); | |
$all_sessions = $sessions->get_all(); | |
if ( count($all_sessions) >= 5 ) { | |
$flag=0; | |
$previous_login = get_user_meta($user->ID,'last_activity',true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('wplms_finish_course_check',function($flag,$course_curriculum){ | |
$user_id = get_current_user_id(); | |
global $post; | |
if($post->post_type != 'course'){return $flag;} | |
$course_id = $post->ID; | |
global $wpdb; | |
$members_assignment_marks = $wpdb->get_results( $wpdb->prepare("SELECT meta_value as marks,post_id as assignment_id FROM {$wpdb->postmeta} where meta_key=%d AND post_id IN (SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='vibe_assignment_course' AND meta_value = %d)",$user_id,$course_id), ARRAY_A); | |
if(isset($members_assignment_marks) && is_array($members_assignment_marks) && count($members_assignment_marks)){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Screenshot of how this works : http://prntscr.com/g1qkzf | |
add_action('in_admin_footer',function(){ | |
if(isset($_POST['delete_3_month_users']) && wp_verify_nonce($_POST['delete_3_month'],'delete_3_month') && current_user_can('manage_options')){ | |
global $wpdb; | |
$results = $wpdb->get_results("SELECT user_id FROM {$wpdb->usermeta} WHERE `meta_key` = 'last_activity' and `meta_value` <= DATE_SUB(NOW(), INTERVAL 3 MONTH)"); // change interval to change duration. | |
if(is_array($results)){ | |
echo '<div style="padding:15px;background:#fff;border:1px solid #eee;margin:15px 0;"><ol>'; | |
if(count($results)){foreach($results as $result){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Ping test from vibethemes server</h1> | |
<?php | |
$host = $_GET['host']; | |
if(empty($host)){die();} | |
if(strlen($host) > 50){die();} | |
set_error_handler(function($errno, $errstr, $errfile, $errline, array $errcontext) { | |
if (0 === error_reporting()) { | |
return false; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.homethreesteps{position:relative;padding:60px 0 0 55px;font-size:13px}.homethreesteps h4{font-size:16px;font-weight:600;margin:0 0 10px;padding:0}.homethreesteps i{font-size:28px;color:#2299dc;position:absolute;left:0;top:75px}.stripe.homesixsections{margin-top:-10px;box-shadow:0 -1px 0 rgba(0,0,0,0.1);text-align:center;padding:60px 0;background:#f3f3f3;display:inline-block;width:100%}.homesixsections h2{font-size:32px;font-weight:600;margin:0 0 20px}.homesixsections h2+p{font-size:16px;color:#666}.homesixsections .column_content{padding:30px;font-size:13px}.homesixsections .column_content i{font-size:36px}.homesixsections .column_content h4{font-size:18px;font-weight:600;margin:0 0 10px}.home header + section#content{padding-top:0}.parallaxhome{padding-bottom:0 !important}.parallaxhome .parallax_content{padding:120px 0 60px;top:20vh}.parallaxhome h2{font-size:8em;line-height:1;font-weight:800;color:#fff;text-shadow:0 0 12px #444;padding:60px 0 0}.parallaxhome h3{font-size:3em;font-weight:800;color:#fff;text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Copy code from here | |
add_filter('wplms_course_nav_menu',function($menu){ foreach($menu as $key => $item){if($item['id'] == 'home'){$menu[$key]['label']= 'MY Home';} } return $menu;}); | |
//Till here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Copy Code from here | |
add_action('init',function(){ | |
$var = get_option('wplms_products_imported_example'); | |
if(!empty($var)) | |
return; |