Skip to content

Instantly share code, notes, and snippets.

View itsjusteileen's full-sized avatar
🎯
Focusing

Eileen Violini itsjusteileen

🎯
Focusing
View GitHub Profile
<?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";
@itsjusteileen
itsjusteileen / sidetrack_mailchimp_listsubscribe_fields.php
Last active May 18, 2018 15:09 — forked from strangerstudios/my_pmpro_mailchimp_listsubscribe_fields.php
Example of using the pmpro_mailchimp_listsubscribe_fields filter to send extra fields to MailChimp.
/*
Sync fields to MailChimp
*/
function sidetrack_mailchimp_listsubscribe_fields($fields, $user)
{
$new_fields = array(
"NEWSLETTER SELECTION" => $user->sidetrack_newsletter_selection);
$fields = array_merge($fields, $new_fields);
@itsjusteileen
itsjusteileen / next_payment_date_account.php
Created June 30, 2018 23:56 — forked from andrewlimaza/next_payment_date_account.php
Show next payment date under the 'Expiration' field in the PMPro Account Page
<?php
/**
* Show next payment date under 'Expiration' field in PMPro account page.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Works for PayPal Express and Stripe payment gateways.
* www.paidmembershipspro.com
*/
// Change the expiration text to show the next payment date instead of the expiration date
// This hook is setup in the wp_renewal_dates_setup function below
function my_pmpro_expiration_text($expiration_text) {
@itsjusteileen
itsjusteileen / customize-pmpro-login-redirect-url.php
Created July 1, 2018 00:03 — forked from pbrocks/customize-pmpro-login-redirect-url.php
Redirect your members based on their PMPro subscription level. If any users aren't members, the site's home url is returned.
<?php
/**
* customize_pmpro_login_redirect_url Creates conditions for each level to have its own confirmation URL
*
* @param [type] $return_url Different URL for each level
* @param [type] $request URL the user is coming from, ie login url.
* @param [type] $user user data
* @return [type] The URL of the level for user logging in
*/
function customize_pmpro_login_redirect_url( $return_url, $request, $user ) {
@itsjusteileen
itsjusteileen / pmpro-replacement-login-redirect.php
Created July 1, 2018 00:04 — forked from pbrocks/pmpro-replacement-login-redirect.php
Replacement redirect for logins after TML update. This recipe will redirect PMPro admins to dashboard reports, single out subscribers to go to the Account page and everyone else to the Invoice page.
<?php
/**
* Redirect user based on user role after successful login.
*
* $pmpro_pages returns an array:
* * $pmpro_pages['account']
* * $pmpro_pages['billing']
* * $pmpro_pages['cancel']
* * $pmpro_pages['checkout']
* * $pmpro_pages['confirmation']
@itsjusteileen
itsjusteileen / pmpro-pmproap-text-changes.php
Created July 5, 2018 19:48 — forked from pbrocks/pmpro-pmproap-text-changes.php
Add this your customizations plugin to alter text for PMPro Add On Packages.
<?php
/**
* Add to PMPro Customizations plugin. Be sure not to include the opening php tag in line 1.
*
* Add this your customizations plugin to alter text for PMPro Add On Packages.
*/
add_action( 'pmpro_invoice_bullets_top', 'pmproap_pmpro_invoice_links_top' );
add_action( 'pmpro_invoice_bullets_top', 'pmproap_pmpro_member_links_top' );
function pmproap_pmpro_invoice_links_top() {
$invoice_title = 'Purchased Add Ons';
<?php
function my_pmpro_members_list_csv_extra_columns($columns)
{
$columns["donation"] = "my_extra_column_donation";
return $columns;
}
add_filter("pmpro_members_list_csv_extra_columns", "my_pmpro_members_list_csv_extra_columns", 10);
@itsjusteileen
itsjusteileen / directory.php
Created July 31, 2018 19:46 — forked from greathmaster/directory.php
Custom PMPro Member Directory template that links directory entry to their BuddyPress profile instead of the PMPro Member Directory Profile
<?php
/*
->Desc: Custom PMPro Member Directory template that links directory entry to their BuddyPress profile instead of the PMPro Member Directory Profile
->To use: copy this file (directory.php) into [YOUR ACTIVE THEME]/paid-memberships-pro/pmpro-member-directory/
*/
/*
This shortcode will display the members list and additional content based on the defined attributes.
*/
@itsjusteileen
itsjusteileen / pmpro_next_billing_date_customization.php
Created September 22, 2018 14:56 — forked from dparker1005/pmpro_next_billing_date_customization.php
Adds the next billing date for a recurring membership to the Members List page of Paid Memberships Pro and the CSV file generated by it.
<?php
/*
* To add 'Next Billing Date' to Members List
*/
//Add 'Next Billing Date' Column to Members List Header
function my_pmpro_memberslist_extra_cols_header($theusers)
{
?>
<th><?php _e('Next Billing Date', 'pmpro');?></th>
<?php
@itsjusteileen
itsjusteileen / pmpro_manage_users_columns.php
Last active September 22, 2018 15:03 — forked from strangerstudios/my_pmpro_manage_users_columns.php
Add extra column for city and state to Members List table for user field added via PMPro City and State Add On
//Add 'City' Column to Users List Header
function pmpro_manage_users_columns($columns) {
$columns['city'] = 'City';
return $columns;
}
add_filter('manage_users_columns', 'pmpro_manage_users_columns');
//Add 'City' Column to Users List Rows
function pmpro_manage_users_custom_column($value, $column_name, $user_id) {
$theuser = get_userdata( $user_id );