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
<IfModule mod_rewrite.c> | |
RewriteEngine OnRewriteBase | |
/RewriteCond %{REQUEST_URI} "/thank-you/" | |
[NC,OR]RewriteCond %{REQUEST_URI} "/login/" | |
[NC,OR]RewriteCond %{REQUEST_URI} "/account/" | |
[NC,OR]RewriteCond %{REQUEST_URI} "/register/" | |
[NC,OR]RewriteCond %{REQUEST_URI} "/mepr/" | |
[NC,OR]RewriteCond %{REQUEST_URI} "/unauthorized/" | |
[NC,OR]RewriteRule ^ - [E=nocache:true]Header always set Cache-Control "no-cache" env=nocacheWordPressProtect captcha, 2 | |
</IfModule> |
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
function mepr_cust_registration_input($product_id) { | |
global $post; | |
$input_str = "<input type='hidden' name='mepr_cust_current_page_id' id='mepr_cust_current_page_id' value='{$post->ID}'/>"; | |
echo $input_str; | |
} | |
add_action('mepr-checkout-before-submit', 'mepr_cust_registration_input'); | |
function mper_cust_thankyou_url_params($url, $args) { | |
if (isset($_REQUEST['mepr_cust_current_page_id']) && $_REQUEST['mepr_cust_current_page_id']) { | |
$param_str = http_build_query($args); |
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_filter('mepr-allow-multiple-upgrades-downgrades', function($allow, $user, $sub_in_group, $product) { | |
return true; | |
}, 10, 4); | |
add_filter( 'mepr-proration', function ( $prorations, $old_amount, $new_amount, $old_period, $new_period, $old_days_left, $old_sub, $new_sub, $reset_period ) { | |
//This only works for recurring to recurring upgrades during a prorate trial, | |
//so if that's not the case - just return the usual proration and skip all this. | |
//NOTE: If the old sub had a trial that the proration was applied to - this won't work |
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_enqueue_scripts', function () { | |
mper_print_scripts(); | |
}, 99999); | |
function mper_print_scripts() { | |
$list = ''; | |
//Print all loaded Styles (CSS) | |
global $wp_styles; | |
foreach( $wp_styles->queue as $style ) : |
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_filter('esaf_validate_options', function($errors) { | |
$return_errors = []; | |
$ecommerce_message = __('You must enable at least one eCommerce Payment Integration.', 'easy-affiliate'); | |
foreach($errors as $error_msg) { | |
if ($error_msg != $ecommerce_message) { | |
$return_errors[] = $error_msg; | |
} | |
} |
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
SELECT l.id, l.url, l.slug, l.name, l.redirect_type, | |
l.track_me, l.nofollow, l.sponsored, l.param_forwarding, | |
gt.meta_value AS google_tracking, d.meta_value AS delay, | |
l.created_at AS created_at, l.updated_at AS last_updated_at , | |
(SELECT GROUP_CONCAT(DISTINCT t.slug ORDER BY t.slug ASC SEPARATOR ',') | |
FROM wp_terms AS t | |
JOIN wp_term_taxonomy AS tt | |
ON t.term_id = tt.term_id | |
AND tt.taxonomy = 'pretty-link-category' | |
JOIN wp_term_relationships AS tr |
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 | |
//You must include [latexpage] at the beginning of each question (inside the input box in the quiz builder) | |
//in order for the parser to work properly. | |
add_filter('mepr_view_get_string_/quizzes/questions/essay', 'mpcs_run_quicklatex', 10, 2); | |
add_filter('mepr_view_get_string_/quizzes/questions/multiple-answer', 'mpcs_run_quicklatex', 10, 2); | |
add_filter('mepr_view_get_string_/quizzes/questions/multiple-choice', 'mpcs_run_quicklatex', 10, 2); | |
add_filter('mepr_view_get_string_/quizzes/questions/short-answer', 'mpcs_run_quicklatex', 10, 2); | |
add_filter('mepr_view_get_string_/quizzes/questions/true-false', 'mpcs_run_quicklatex', 10, 2); |
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 | |
//Shortcode Example: [mepr-sub-expiration membership='123'] | |
function mepr_sub_expiration_shortcode($atts = [], $content = null, $tag = '') { | |
$sub_expire_html = ''; | |
if($atts['membership'] && is_numeric($atts['membership'])) { | |
$date_str = MeprUser::get_user_product_expires_at_date(get_current_user_id(), $atts['membership']); | |
if ($date_str) { | |
$date = date_create($date_str); |
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_remove_subscriber_role($roles_to_remove, $wp_user) { | |
$mepr_user = new MeprUser($wp_user->ID); | |
if (mepr_is_member_inactive($mepr_user)) { | |
$roles_to_remove[] = 'subscriber'; | |
} else { | |
$active_memberships = $mepr_user->active_product_subscriptions('ids', true); | |
if (!empty($active_memberships)) { | |
$roles_to_remove[] = 'ex-subscriber'; |
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('mepr-admin-transactions-cols', function ($cols) { | |
$cols['col_txn_invoice'] = __('Invoice No.', 'memberpress-pdf-invoice'); | |
return $cols; | |
}); | |
add_action('mepr-admin-transactions-cell', function ($column_name, $rec, $attributes) { | |
if ($column_name === 'col_txn_invoice') { | |
?> | |
<td <?php echo $attributes; ?>> |
NewerOlder