Skip to content

Instantly share code, notes, and snippets.

View JarrydLong's full-sized avatar

Jarryd Long JarrydLong

  • Paid Memberships Pro
  • South Africa
  • 20:57 (UTC +02:00)
  • X @jarrydlong
View GitHub Profile
@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.
@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/
*/
@JarrydLong
JarrydLong / generate-username-from-email-pmpro.php
Last active December 2, 2024 14:00 — forked from andrewlimaza/generate-username-from-email-pmpro.php
Generate a username during checkout for user [Paid Memberships Pro]
<?php
/**
* Generate a username at PMPro checkout from email for users.
* Hide your 'username' field using custom CSS.
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_generate_username_at_checkout() {
// Make sure PMPro is installed and the function to get the level at checkout exists.
@JarrydLong
JarrydLong / my_pmpro_report_login_wp_visits.php
Created July 26, 2024 08:59 — forked from ideadude/my_pmpro_report_login_wp_visits_only_for_users.php
Change PMPro to only track visits for logged in users.
/**
* Change PMPro to not track visits at all
* Add this code into a custom plugin or code snippet.
*/
function my_pmpro_report_login_wp_visits_only_for_users() {
remove_action( 'wp', 'pmpro_report_login_wp_visits' );
}
add_action( 'init', 'my_pmpro_report_login_wp_visits_only_for_users' );
@JarrydLong
JarrydLong / move-pass-bemail-pmpro.php
Last active July 22, 2024 12:13 — forked from andrewlimaza/move-pass-bemail-pmpro.php
Move Password div below email div jQuery
<?php
/**
* PMPro 3.1+ compatible
* Small jQuery snippet to move password field below email field for Paid Memberships Pro.
* Please note this will affect all instances such as Signup Shortcode, checkout page.
* To only load this on a specific page, please use the 'is_page' WordPress function in a condition.
*/
function my_move_password_below_bemail() {
?>
<script>
@JarrydLong
JarrydLong / my_pmpro_always_show_renew_levels.php
Created July 5, 2024 12:20 — forked from MaryOJob/my_pmpro_always_show_renew_levels.php
Always show renew links for certain PMPro levels if the member already has that level.
<?php // do not copy this line
/*
* This recipe would always show the renew link on the membership account page for the specified levels on line 13
* Add the below code to your PMPro Customizations Plugin:
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
// always show renew links for certain levels if the member already has that level.
//Changes default content
function mypmpro_change_user_pages_content($postdata, $user, $level){
$postdata['post_content'] = 'My Content Here';
return $postdata;
}
add_filter('pmpro_user_page_postdata', 'mypmpro_change_user_pages_content', 10, 3);