Skip to content

Instantly share code, notes, and snippets.

Avatar

Jarryd Long JarrydLong

  • Paid Memberships Pro
  • South Africa
  • Twitter @jarrydlong
View GitHub Profile
View change_choose_your_payment_method_txt_pmpro.php
<?php
/**
* This code is used to change 'Choose your Payment Method' text in Paid Memberships Pro.
* Add the function into your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function change_choose_your_payment( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Choose your Payment Method' :
View mypmpro-change-marker-limit.php
<?php //do not copy
/**
* Changes the limit for the number of markers to display on a map
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*
View mypmpromd-override-profile-title.php
<?php //do not copy
/**
* Unhooks the current filter that changes the profile name
*/
function mypmpro_override_title_action() {
remove_filter("the_title", "pmpromd_the_title", 10, 2);
}
add_action( 'init', 'mypmpro_override_title_action' );
View mypmpro-add-member-admin-addon-address-fields.php
<?php //do not copy
/**
* Add billing fields to the Add Member from Admin Add On page
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*
View pmpro-show-adverts-non-members.php
<?php
/**
* Displays ads for non-members on your site
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
View mypmpro-costa-rican-colon.php
<?php //do not copy
function mypmpro_currency_crc_symbol(){
global $pmpro_currency_symbol;
if ( trim( $pmpro_currency_symbol ) == 'CRC') { // The currency code
$pmpro_currency_symbol = '₡'; // Change the code here
}
@JarrydLong
JarrydLong / my_pmpro_checkout_start_date.php
Created Mar 14, 2022 — forked from strangerstudios/my_pmpro_checkout_start_date.php
PMPro Adjust start date to the first following Sunday.
View my_pmpro_checkout_start_date.php
<?php //do not copy
/*
Adjust start date to the first following Sunday for a specific level
*/
function my_pmpro_checkout_start_date( $startdate, $user_id, $level ){
if( $level->id == 8 ) { //Change to the preferred level you want this to apply to
//which day is it
View mypmpro-membership-number-orders.php
<?php //do not copy
/*
* Adds a "Membership Number" column to the Orders list and order CSV export
*/
function mypmpro_membership_number( $order ) {
return get_user_meta( $order->user_id, 'membership_number', true );
}
View mypmpro-return-my-levels.php
<?php //do not copy
function mypmpro_memership_levels(){
global $current_user;
$user_id = $current_user->ID;
if( !function_exists( 'pmpro_getMembershipLevelsForUser' ) ) {
return;
View mypmpro-generate-roles.php
<?php //do not copy
function mypmpro_generate_roles(){
if( !empty( $_REQUEST['generate_roles'] ) ) {
$all_levels = pmpro_getAllLevels( true, false );
$capabilities = array();
if( !empty( $role_key ) ){