Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working remotely 😈

Mary Job MaryOJob

🏠
Working remotely 😈
View GitHub Profile
@MaryOJob
MaryOJob / register-helper-test1.php
Last active Nov 21, 2019
Adding Five Custom Fields to PMPro Accounts Page
View register-helper-test1.php
<?php
/**
* Register Helper example for five fields. This is a test Register Helper example.
* Please add the below code to your custom plugin or Code Snippets Plugin by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmprorh_init() {
//don't break if Register Helper is not loaded
if(!function_exists( "pmprorh_add_registration_field" )) {
@MaryOJob
MaryOJob / my_pmpro_invoice_member_emails.php
Last active Nov 25, 2019
BCC all PMPro Invoice Emails to a Certain Address
View my_pmpro_invoice_member_emails.php
<?php
/*
Bcc admin on PMPro members invoice emails only
You can change the conditional to check for a certain $email->template or some other condition before adding the BCC.
*/
function my_pmpro_email_headers_admin_emails($headers, $email)
{
//bcc checkout emails
@MaryOJob
MaryOJob / my_pmpro_change_state_to_county.php
Last active Nov 26, 2019
Change the word "State" to "County" for Paid Memberships Pro
View my_pmpro_change_state_to_county.php
<?php
/* This replaces all fields with 'state' with 'county'
* Add the code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_replace_text_for_pmpro_pages($text) {
global $pmpro_pages;
if ( is_page( $pmpro_pages['checkout'] ) || is_page( $pmpro_pages['confirmation'] ) || is_page( $pmpro_pages['account'] ) || is_page( $pmpro_pages['billing'] ) || is_page( $pmpro_pages['cancel'] ) || is_page( $pmpro_pages['invoice'] ) || is_page( $pmpro_pages['levels'] ) ) {
$text = str_replace( 'State', 'County', $text) ;
@MaryOJob
MaryOJob / my_pmpro_email_headers_admin_emails.php
Last active Dec 12, 2019 — forked from femiyb/my_pmpro_email_headers_admin_emails.php
BCC all PMPro Register/Checkout Emails to a Certain Address
View my_pmpro_email_headers_admin_emails.php
<?php
/*
Add bcc for checkout emails
*/
function my_pmpro_email_headers_admin_emails($headers, $email) {
//bcc checkout emails
if(strpos($email->template, "checkout_") !== false) {
//add bcc
$headers[] = "Bcc:" . "otheremail@domain.com";
}
@MaryOJob
MaryOJob / my_pmpro_custom_text_field.php
Last active Aug 5, 2020
Adding a Custom Text Field to PMPro Checkout Page
View my_pmpro_custom_text_field.php
<?php
/**
* Register Helper example for five fields. This is a test Register Helper example.
* Please add the below code to your custom plugin or Code Snippets Plugin by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmprorh_init() {
//don't break if Register Helper is not loaded
if(!function_exists( "pmprorh_add_registration_field" )) {
@MaryOJob
MaryOJob / my_pmpro_sync_xprofile_to_member_directory.php
Last active Sep 21, 2020
Sync BuddyPress Profile Fields with PMPro using Register Helper
View my_pmpro_sync_xprofile_to_member_directory.php
<?php
/**
* Based on the Register Helper example.
* We've added a "buddypress" option for each field
* set to the XProfile name we used when setting up
* the fields in the BuddyPress extended profile.
* If the PMPro BuddyPress Add On is activated
* then the fields will be synchronized.
* Register Helper: https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/
@MaryOJob
MaryOJob / my_pmpro_custom_select_and_text_fields_to_register_helper.php
Last active Jan 6, 2020
Adding A Custom Field (Select & Text) to Register Helper
View my_pmpro_custom_select_and_text_fields_to_register_helper.php
<?php
/**
* Register Helper example for a select and text field.
* Please add the below code to your custom plugin or Code Snippets Plugin by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmprorh_init() {
//don't break if Register Helper is not loaded
if(!function_exists( "pmprorh_add_registration_field" )) {
@MaryOJob
MaryOJob / my_pmpro_add_addtional_field_to_register_helper.php
Last active Jun 29, 2020
Already have Register Helper Fields Created and want to Add more fields to a new location on your checkout page? - Use this script to Add to existing Customization
View my_pmpro_add_addtional_field_to_register_helper.php
<?php // DO NOT COPY THIS LINE TO AVOID A FATAL ERROR. Copy from below please.
/**
* Please only add this script if you have previously added a custom field to your Register Helper and you need to add another field
* You would not be redeclaring the function seeing as you have done that already in your previous code snippet
*/
// You can copy and paste the below into your previous snippet, then update it with your own information
$fields[] = new PMProRH_Field(
@MaryOJob
MaryOJob / my_pmpro_login_redirect_url.php
Created Jan 15, 2020 — forked from travislima/my_pmpro_login_redirect_url.php
Redirect on login if user has any failed payments. (Requires Paid Memberships Pro Failed Payment Limit Add On)
View my_pmpro_login_redirect_url.php
<?php
/*
* Redirect on login if user has any failed payments. (Requires Paid Memberships Pro Failed Payment Limit Add On)
* Adjust the code on the line the line "site_url( ' payment-failed')" to redirect to page of your prefereance.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_login_redirect_url( $url, $request, $user ) {
@MaryOJob
MaryOJob / my_pmpro_sponsored_members_charge_recievers.php
Last active Jan 22, 2020
Allows sponsored recipients to individually pay for the seats given by their sponsored giver.
View my_pmpro_sponsored_members_charge_recievers.php
<?php
/* This codes requires you to have the sponsored Members Add On up and configured.
This code should also be added together with your configured sponsored members code in your PMPro customizations Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
This script is an example that allows level 2 to purchase 5 membership accounts for level 3 but
have level 3 individualy pay $20 for their membership accounts.
Please see the add on guide for more attributes that can be configured for your sponsored members add on here: https://www.paidmembershipspro.com/add-ons/pmpro-sponsored-members/
*/
global $pmprosm_sponsored_account_levels;
You can’t perform that action at this time.