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 | |
/* | |
* Usage: [eab_recurring id="XXXX"] | |
*/ | |
function eab_recurring_cb( $args ) { | |
$args = shortcode_atts( array( | |
'id' => false, | |
'slug' => 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
<?php | |
<?php | |
/* | |
Plugin Name: Recurring Event in Calendar ShortCode | |
Description: Use [eab_calendar_recurring id="xx"] to show all instances of a recurring event | |
Plugin URI: http://premium.wpmudev.org/project/events-and-booking | |
Version: 1.0 | |
Author: WPMU DEV | |
AddonType: Events |
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 | |
function course_list( $atts ) { | |
extract( shortcode_atts( array( | |
'course_id' => '', | |
'status' => 'publish', | |
'instructor' => '', // Note, one or the other | |
'instructor_msg' => __( 'The Instructor does not have any courses assigned yet.', 'cp' ), | |
'student' => '', // If both student and instructor is specified only student will be used |
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 | |
add_filter( 'bp_blogs_get_blogs', 'bp_blogs_get_blogs_cb', 99, 2 ); | |
function bp_blogs_get_blogs_cb( $blogs, $r ) { | |
foreach( $blogs['blogs'] as $key => $blog ){ | |
if( ! is_pro_site( $blog->blog_id ) ) { | |
unset( $blogs['blogs'][$key] ); | |
$blogs['total']--; | |
} |
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 | |
add_action( 'user_register', 'assign_membership_on_register', 10, 1 ); | |
function assign_membership_on_register( $user_id ) { | |
$membership_id = 1343; | |
$member = MS_Factory::load( 'MS_Model_Member', $user_id ); | |
$subscription = $member->add_membership( $membership_id ); | |
if ( $member->has_membership() ) { |
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 | |
/** | |
* Usage: [course_list limit="5" pagination="true"] | |
*/ | |
function edit_coursepress_shortcode(){ | |
remove_shortcode( 'course_list'); | |
add_shortcode( 'course_list', 'course_list_cb'); | |
} |
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 | |
add_filter( 'wp_footer', 'wp_footer_cb' ); | |
function wp_footer_cb() { | |
?> | |
<style> | |
.eav_add_field{margin: 10px 0;} | |
#eab_booking_form .eav_add_field{display: none} | |
</style> | |
<script type="text/javascript"> |
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 | |
add_action( 'user_register', 'assign_membership_on_register', 10, 1 ); | |
function assign_membership_on_register( $user_id ){ | |
$user_info = get_userdata( $user_id ); | |
$email = $user_info->user_email; | |
// Here school1, school2 are the email domains, ms_id is membership id and bp_id is the group id | |
$data = array( | |
'school1' => array( | |
'ms_id' => 1343, |
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 | |
add_action( 'wp_footer', 'show_price' ); | |
function show_price() { | |
?> | |
<script type="text/javascript"> | |
jQuery(function($) { | |
$(document).on('click', '.choose-plan-button', function() { | |
var price = $(this).closest('ul').find('.summary .price:visible .plan-price').text(); | |
if($('.price_custom_label').length) |
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 | |
// Define the number of groups can be created by paid users | |
if( ! defined( 'PAID_USER_GROUP_LIMIT' ) ) define( 'PAID_USER_GROUP_LIMIT', 5 ); | |
// Define the error message | |
if( ! defined( 'PAID_USER_GROUP_LIMIT_PROTECTION_MSG' ) ) define( 'PAID_USER_GROUP_LIMIT_PROTECTION_MSG', "Either You have exceeded the no. of groups you can create or you don't have permission to create group." ); | |
function is_custom_free_member() { | |
if( is_user_logged_in() ){ | |
if( current_user_is( 's2member_level0' ) ){ |