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
/* | |
Make !!startdate!! and !!enddate!! available for all PMPro emails. | |
Add this code to a custom plugin. | |
*/ | |
function my_pmpro_email_data($data, $email) { | |
$user = get_user_by("login", $data['user_login']); | |
$level = pmpro_getMembershipLevelForUser($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
<?php | |
//Copy the code below into your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
function add_my_report_dashboard(){ | |
if( ! defined( 'PMPRO_DIR' ) || ! current_user_can( 'manage_options' ) ){ | |
return; | |
} | |
wp_add_dashboard_widget( | |
'pmpro_membership_dashboard', // Widget slug. |
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_invoice_address() { | |
?> | |
<li><strong>Paid To:</strong><br />My Business<br />123 The Street<br />City, XX 12345 USA</li> | |
<?php | |
//<li><strong>VAT Number:</strong> BG999999999</li> | |
} | |
add_action('pmpro_invoice_bullets_bottom', 'my_pmpro_invoice_address'); |
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 | |
//Address merge types must be handled in a very specific format | |
function my_pmpro_mailchimp_listsubscribe_fields($fields, $user) | |
{ | |
$user_info = get_userdata($user->ID); | |
$new_fields = array( | |
"FNAME" => $user->first_name, | |
"EMAIL" => $user->email, | |
"LNAME" => $user->last_name, |
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
/* | |
Sync fields to MailChimp | |
*/ | |
function my_pmpro_mailchimp_listsubscribe_fields($fields, $user) | |
{ | |
//get level | |
$level = pmpro_getMembershipLevelForUser($user->ID); | |
//get order | |
$order = new MemberOrder(); | |
$order->getLastMemberOrder($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
/* | |
Disable spaces and dashes in credit card fields on the PMPro checkout page. | |
Add this code to your active theme's functions.php or a custom plugin. | |
This code may not work in all cases. It is: | |
* Adding JS into the <head> tag of your site (this makes sure it runs before Gateway JS) | |
* Only being added on the checkout and billing pages specified in the PMPro page settings (i.e. doesn't work if you have multiple checkout pages) | |
* Listening for when the #pmpro_form form is submitted. | |
* Changing the field with ID = "AccountNumber". Some gateways have different field ids and names. |
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
/* | |
Add a button/etc after the domain register helper field. | |
Add this code to your active theme's functions.php or a custom plugin. | |
Edit the $html .= ... line below to the HTML you need. You may want to load any assocaited javascript separately. | |
*/ | |
function my_pmprorh_get_html($html, $field) { | |
if($field->name == 'domain') { | |
$html .= ' | |
<button name="mybutton">Check</button> |
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: Customized PMPro Account Shortcode | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Add [pmpro_account_customized] shortcode. | |
Version: .1 | |
Author: Stranger Studios | |
Author URI: http://www.strangerstudios.com | |
*/ |
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
/* | |
Add last paymenet date and next payment date to the members list and export CSV | |
Add this code into a custom plugin or your active theme's functions.php. | |
Note that "last payment" value will get the last order in "success", "cancelled", or "" status. | |
(Oddly enough, cancelled here means that the membership was cancelled, not the order.) | |
The "next payment" value is an estimate based on the billing cycle of the subscription and the last order date. | |
It may be off form the actual recurring date set at the gateway, especially if the subscription was updated at the gateway. |