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 | |
use memberpress\courses\helpers as helpers; | |
use memberpress\courses\models as models; | |
use memberpress\courses\controllers as controllers; | |
use memberpress\courses as base; | |
// Load header | |
echo helpers\Courses::get_classroom_header(); | |
// Start the Loop. | |
while ( have_posts() ) : |
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 | |
function mepr_change_subject($subject, $recipients, $message, $headers) { | |
if(strpos(strtolower($subject), 'password reset') !== false) { | |
$subject = 'New Subject - Password Reset'; | |
} | |
return $subject; | |
} | |
add_filter('mepr-wp-mail-subject', 'mepr_change_subject', 10, 4); |
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 | |
/* | |
INSTRUCTIONS FOR THIS CODE: | |
On your RSS URL in Aweber add &allow_aweber=true to the end of it. | |
Then copy the below code and paste it into a plugin like My Custom Functions or Code Snippets on your site. | |
This will allow Aweber through the content blocks. | |
*/ | |
function allow_aweber_through($block, $post, $uri) { | |
if(isset($_GET['allow_aweber'])) { |
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(!defined('ABSPATH')) {die('You are not allowed to call this page directly.');} ?> | |
<?php | |
$products = $group->products(); | |
$check_products = array(); | |
$credit_card_products = array(); | |
// Find credit card and check memberships. | |
if(!empty($products)) { | |
foreach($products as $product) { |
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 | |
function mepr_validate_emails_signup($errors) { | |
$allowed_words = array('university'); // ADD ALLOWED WORDS HERE SEPARATED BY COMMAS. | |
$email = isset($_POST['user_email']) ? trim($_POST['user_email']) : ''; | |
$is_allowed = false; | |
// If email is empty for some reason or the membership shouldn't be validated, then just don't do anything. | |
if($_POST['mepr_product_id'] != 123 || empty($email)) { | |
return $errors; |
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 | |
function mepr_change_subject($subject, $recipients, $message, $headers) { | |
if(strpos(strtolower($subject), 'set your new password') !== false) { | |
$subject = 'New Subject - Set Your New Password'; | |
} | |
if(strpos(strtolower($subject), 'your new password') !== false) { | |
$subject = 'New Subject - Your New Password'; | |
} |
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 | |
function mpcs_all_courses($atts) { | |
$content = ''; | |
$courses = get_posts( | |
array( | |
'post_type' => 'mpcs-course', | |
'post_status' => 'publish', | |
'posts_per_page' => '-1', | |
'orderby' => 'title', |
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 | |
function mepr_validate_user_role($errors) { | |
// Memberships to apply restrictions on. | |
$membership_ids = array('123', '321', '12345'); | |
// The current membership isn't being validated, so don't do anything else. | |
if(!in_array($_POST['mepr_product_id'], $membership_ids)) { | |
return $errors; | |
} |
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 | |
use memberpress\courses as base; | |
use memberpress\courses\helpers as helpers; | |
use memberpress\courses\models as models; | |
// // use memberpress\courses\controllers as controllers; | |
// use memberpress\courses as base; | |
use memberpress\courses\lib as lib; | |
$search = isset($_GET['s']) ? esc_attr($_GET['s']) : ''; | |
$category = isset($_GET['category']) ? esc_attr($_GET['category']) : ''; |
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 | |
$user_id = get_current_user_id(); | |
if ( ! $user_id ) { | |
return; // Just return if user is not logged in. | |
} | |
$query = array( | |
'posts_per_page' => '-1', | |
'author' => $user_id, |