Skip to content

Instantly share code, notes, and snippets.

View MaryOJob's full-sized avatar
🏠
Working remotely 😈

Mary Job MaryOJob

🏠
Working remotely 😈
View GitHub Profile
@MaryOJob
MaryOJob / register-helper-test1.php
Last active November 21, 2019 12:21
Adding Five Custom Fields to PMPro Accounts Page
<?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 September 22, 2021 19:40
BCC all PMPro Emails to More Than One Email Address
<?php // Do not copy this line
/*
Bcc more than one admin on PMPro members emails
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 emails already going to admin_email
@MaryOJob
MaryOJob / my_pmpro_change_state_to_county.php
Last active November 17, 2020 13:27
Change the word "State" to "County" for Paid Memberships Pro
<?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 December 12, 2019 08:11 — forked from femiyb/my_pmpro_email_headers_admin_emails.php
BCC all PMPro Register/Checkout Emails to a Certain Address
<?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 August 5, 2020 18:53
Adding a Custom Text Field to PMPro Checkout Page
<?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 July 23, 2021 17:52
Sync BuddyPress Profile Fields with PMPro using Register Helper
<?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 January 6, 2020 10:03
Adding A Custom Field (Select & Text) to Register Helper
<?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 June 29, 2020 10:09
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
<?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 January 15, 2020 11:41 — 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)
<?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 January 22, 2020 11:21
Allows sponsored recipients to individually pay for the seats given by their sponsored giver.
<?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;