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
<?php | |
if(!class_exists('WPLMS_Customizer_Plugin_Class')) | |
{ | |
class WPLMS_Customizer_Plugin_Class // We'll use this just to avoid function name conflicts | |
{ | |
public function __construct(){ | |
add_filter('wplms_course_stats_list',array($this,'add_custom_course_stat')); | |
add_action('wplms_course_stats_process',array($this,'process_custom_course_stat'),10,7); | |
} // END public function __construct |
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_filter('wplms_before_course_status_api',function($stop,$course_id,$user_id){ | |
$groups = bp_xprofile_get_groups( array( | |
'fetch_fields' => true | |
) ); | |
$cflag= 1; | |
foreach($groups as $group){ | |
if(!empty($group->fields)){ | |
foreach ( $group->fields as $field ) { | |
if($cflag ){ |
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 ) { |
NewerOlder