Skip to content

Instantly share code, notes, and snippets.

View JarrydLong's full-sized avatar

Jarryd Long JarrydLong

  • Paid Memberships Pro
  • South Africa
  • 10:08 (UTC +02:00)
  • X @jarrydlong
View GitHub Profile
<?php //do not copy
/**
* This recipe hides a membership level between two dates. This can be done with multiple levels,
* in this case referencing level x and y for levels 2 and 3.
*
* 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/
@JarrydLong
JarrydLong / my_ipn_redirect.php
Created December 17, 2024 12:11 — forked from ideadude/my_ipn_redirect.php
Redirect MEPR IPN URL to the PMPro IPN URL
/*
Redirect MEPR IPN URL to the PMPro IPN URL, e.g.
https://yoursite.com/mepr/notify/onibvz-5w6/ipn =>
https://yoursite.com/wp-admin/admin-ajax.php?action=ipnhandler
Update line 9 to match the IPN URL given to you by MEPR
*/
function my_ipn_redirect() {
if( defined('PMPRO_DIR') && $_SERVER['REQUEST_URI'] === '/mepr/notify/onibvz-5w6/ipn' ) {
require_once(PMPRO_DIR . "/services/ipnhandler.php");
@JarrydLong
JarrydLong / change-add-first-last-name-to-checkout.php
Created December 13, 2024 06:25 — forked from ipokkel/change-add-first-last-name-to-checkout.php
Change text or translate Add Name to Checkout Add On #pmpro-add-name-to-checkout
<?php
/**
* This recipe changes localized text strings for
* Add Name to Checkout Add On using the gettext filter.
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*
* 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.
@JarrydLong
JarrydLong / change-add-first-last-name-to-checkout.php
Created December 13, 2024 06:25 — forked from ipokkel/change-add-first-last-name-to-checkout.php
Change text or translate Add Name to Checkout Add On #pmpro-add-name-to-checkout
<?php
/**
* This recipe changes localized text strings for
* Add Name to Checkout Add On using the gettext filter.
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*
* 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.
<?php //do not copy
/**
* This recipe adds a !!next_payment_date!! variable to your email templates.
* Note that this will only work with recurring levels and not for levels that expire or are once off.
*
* 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/
@JarrydLong
JarrydLong / minh-my_login_change_text_with_gettext.php
Last active December 6, 2024 09:37 — forked from dwanjuki/my_login_change_text_with_gettext.php
Change / Translate login page text strings with the gettext filter
<?php // do not copy this line
/**
* This recipe changes login page text strings with the gettext filter
*
* 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/
*/
@JarrydLong
JarrydLong / pmpro-addon-package-confirmation-url.php
Created November 27, 2024 12:18 — forked from ipokkel/pmpro-addon-package-confirmation-url.php
Redirect membr back to Addon Package purchased after checkout.
<?php
/**
* Redirect member back to Addon Packages page after checkout.
*
* 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/
*/
<?php //do not copy
/**
* Send a welcome email to the member when creating a new user from the admin dashboard
*
* 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/
*/
<?php //do not copy
function mypmpro_enroll_on_new_course( $course_id, $post, $update ) {
global $wpdb;
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
<?php //do not copy
function mypmpro_remove_map_from_directory_page(){
if( ! empty( $_REQUEST['ps'] ) ){
remove_action( 'pmpro_member_directory_before', 'pmpromm_load_map_directory_page', 10, 2 );
}
}
add_action( 'init', 'mypmpro_remove_map_from_directory_page' );