This file contains 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('bp_course_dynamic_quiz_tag_questions',function($args,$alltags,$quiz_id,$user_id){ | |
//fetch result | |
$user_quiz_result = bp_course_get_quiz_results_meta($quiz_id,$user_id); | |
if(empty($user_quiz_result)){ | |
return $args; | |
} | |
if(is_serialized($user_quiz_result)){ | |
$user_quiz_result = unserialize($user_quiz_result); | |
} |
This file contains 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
class Drip_Expired_Check{ | |
public static $instance; | |
public $time_to_adjust = 0; | |
public static function init(){ | |
if ( is_null( self::$instance ) ) | |
self::$instance = new Drip_Expired_Check(); | |
return self::$instance; | |
} |
This file contains 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('template_redirect',function(){ | |
global $post; | |
if(is_page(vibebp_get_setting('bp_single_page'))){ | |
$wpml_page_id = apply_filters('wplm_object_id',$post_id,'page'); | |
if($post->ID != $wpml_page_id){ | |
$new_url = str_replace(get_permalink($post->ID),get_permalink($wpml_page_id),$_SERVER['REQUEST_URI']); | |
wp_redirect($new_url); | |
exit; | |
} | |
} |
This file contains 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 | |
add_action( 'widgets_init', 'Sample_Widget' ); | |
function Sample_Widget() { | |
register_widget('Sample_Widget'); | |
} | |
class Sample_Widget extends WP_Widget { | |
This file contains 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(){ | |
?> | |
<script>var ajaxurl = '<?php echo admin_url( 'admin-ajax.php' ); ?>'; </script> | |
<?php | |
}); |
This file contains 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_head',function(){ | |
if(is_page_template('barebones.php')){ | |
?> | |
<meta http-equiv="origin-trial" content="DIGITAL GOODS API V2 TOKEN"> | |
<?php | |
} | |
}); |
This file contains 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('my_courses',function($atts,$content=null){ | |
if(empty($atts['user_id'])){ | |
$user_id = get_current_user_id(); | |
}else{ | |
$user_id = $atts['user_id']; | |
} | |
$course_ids = bp_course_get_user_courses($user_id); | |
This file contains 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('template_redirect',function(){ | |
if( is_single() && get_post_type() == 'product' && isset($_GET['redirect'])){ | |
global $woocommerce; | |
$found = false; | |
$product_id = get_the_ID(); | |
$courses = vibe_sanitize(get_post_meta(get_the_ID(),'vibe_courses',false)); | |
if(isset($courses) && is_array($courses) && count($courses)){ | |
if ( sizeof( WC()->cart->get_cart() ) > 0 ) { | |
foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) { |
This file contains 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('wplms_batches_extras',function($batch_id){ | |
$start_batch_date = groups_get_groupmeta($batch_id,'start_batch_date'); | |
if(!empty($start_batch_date)){ | |
echo 'STARTS '.wp_date( get_option( 'date_format' ), $start_batch_date ); | |
} | |
},10,1); |
NewerOlder