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
| function my_custom_memberslist_order($sqlQuery) | |
| { | |
| echo "<a href=".admin_url('admin.php?page=pmpro-memberslist&enddate_sort=asc').">Sort by Enddate ASC</a><br>". | |
| "<a href=".admin_url('admin.php?page=pmpro-memberslist&enddate_sort=desc').">Sort by Enddate DESC</a>"; | |
| if(isset($_REQUEST['enddate_sort']) && ($_REQUEST['enddate_sort'] == 'asc' || $_REQUEST['enddate_sort'] == 'desc')) | |
| { | |
| $sort_order = $_REQUEST['enddate_sort']; | |
| global $wpdb; |
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
| //Adapted from: https://codex.wordpress.org/Plugin_API/Action_Reference/admin_notices | |
| function my_admin_notice() { | |
| if ( isset($_GET['updated']) ) { ?> | |
| <div class="updated notice is-dismissible"> | |
| <?php if (!IS_PROFILE_PAGE )?> | |
| <p><a href="<?php echo esc_url(site_url('/wp-admin/admin.php?page=pmpro-memberslist')); ?>"><?php _e('← Go to Members'); ?></a></p> | |
| </div><?php | |
| } |
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 | |
| /* | |
| Plugin Name: Paid Memberships Pro - Address For Offsite Gateways Add On - Modified | |
| Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-address-for-free-levels/ | |
| Description: Only show address fields for paid levels with offsite gateways in Paid Memberships Pro...otherwise only show first and last name. | |
| Based on: https://github.com/strangerstudios/pmpro-add-name-to-checkout and | |
| http://www.paidmembershipspro.com/2015/03/collect-address-for-free-levels-or-for-offsite-checkout-gateways/ | |
| Version: .3 | |
| Author: Stranger Studios |
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
| function my_pmpro_checkout_level($level) | |
| { | |
| $current_day = date('j'); | |
| $days_in_month = date('t'); | |
| $level->initial_payment = $level->initial_payment*(($days_in_month - $current_day)/$days_in_month); | |
| return $level; | |
| } |
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 my_pmpro_mailchimp_listsubscribe_fields($fields, $user) | |
| { | |
| $new_fields = array( | |
| "groupings" => array( | |
| array( | |
| "name" => "Group1", //or "id" => group category id | |
| "groups" => array("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 | |
| /* | |
| Only allow users to use the trial level once. | |
| Add this code to your active theme's functions.php | |
| or a custom plugin. | |
| Be sure to change the $trial_level_id variable in multiple places. | |
| */ | |
| //record when users gain the trial level | |
| function my_pmpro_after_change_membership_level($level_id, $user_id) | |
| { |
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
| function my_pmpro_user_page_shortcode() | |
| { | |
| global $post; | |
| $pages = wp_list_pages(array("child_of"=>$post->ID, "echo"=>false)); | |
| if(empty($pages)) | |
| { | |
| $pages = "Thank you for your purchase. This page will be updated soon with updates on your order."; | |
| } |
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 my_pmpro_confirmation_url($rurl, $user_id, $pmpro_level) | |
| { | |
| if(pmpro_hasMembershipLevel(1)) | |
| $rurl = "http://example.com/page_1"; | |
| elseif(pmpro_hasMembershipLevel(2)) | |
| $rurl = "http://example.com/page_2"; | |
| elseif(pmpro_hasMembershipLevel(3)) | |
| $rurl = "http://example.com/page_3"; |
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
| function custom_renewal($level) | |
| { | |
| global $wpdb, $current_user; | |
| $levelshistory = $wpdb->get_results("SELECT * FROM $wpdb->pmpro_memberships_users WHERE user_id = '$current_user->ID' ORDER BY id DESC"); | |
| if($levelshistory && $levelshistory[0]->status == 'expired' && $levelshistory[0]->membership_id == $level->id) | |
| { | |
| $level->initial_payment = ($level->initial_payment/2); | |
| } |