Skip to content

Instantly share code, notes, and snippets.

@michaelbeil
michaelbeil / my_logout_go_specified.php
Last active January 6, 2023 23:45 — forked from MaryOJob/my_logout_go_home.php
Redirect users to a specified page when logging out of your PMPro site
<?php // DO NOT COPY THIS LINE
//copy lines 5 onwards into your active theme's function.php or custom plugin for code snippets.
function mypmpro_redirect_logout(){
wp_safe_redirect( '/contact/' ); // use this line to redirect to a specific page on your site
}
add_action('wp_logout','mypmpro_redirect_logout');
@michaelbeil
michaelbeil / pmpro-australia-gst.php
Last active December 27, 2022 19:14 — forked from ideadude/pmpro-australia-gst.php
Paid Memberships Pro - Australia GST
<?php
/*
Plugin Name: Paid Memberships Pro - Australia GST
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-australia-gst/
Description: Apply Australia GST to Checkouts with PMPro
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
/*
<?php
/**
* This recipe will change the name of "Discount Code" to something else for one level
*
* 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/
*/
@michaelbeil
michaelbeil / pmpro_pmpro_not_logged_in_text_filter.php
Last active November 3, 2022 16:36 — forked from kimcoleman/pmpro_pmpro_not_logged_in_text_filter.php
Edit Teaser Messages Depending on Content
<?php
/**
* Edit Teaser Messages Depending on Content
*
*/
function pmpro_pmpro_not_logged_in_text_filter( $text ) {
global $post;
$access = pmpro_has_membership_access( $post->ID, NULL, true );
$level_ids = $access[1];
@michaelbeil
michaelbeil / my-pmpro-change-admin-email.php
Created November 1, 2022 19:18 — forked from andrewlimaza/my-pmpro-change-admin-email.php
Change the admin email for all Paid Memberships Pro admin emails.
<?php
/**
* Change the email address for all admin related emails in Paid Memberships Pro.
* Follow this guide to add custom code to your WordPress site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_change_admin_to_email( $user_email, $email ){
if( strpos( $email->template, "_admin" ) !== false ) {
$user_email = 'memberadmin@someemail.co';
}
@michaelbeil
michaelbeil / appsumo-code-redeem-with-pmpro-signup-shortcode.php
Last active October 26, 2022 15:25 — forked from ipokkel/appsumo-code-redeem-with-pmpro-signup-shortcode.php
An example of a customized AppSumo Code Redeem page using PMPro Signup Shortcode.
<?php
/**
* This recipe creates a customized easy signup and code redeem page
* for AppSumo promotions.
*
* This recipe assumes the following:
* PMPro Signup Shortcode is installed and active.
* @link https://www.paidmembershipspro.com/add-ons/pmpro-signup-shortcode/
*
* You have a page with [pmpro_signup] shortcode and it is configured correctly.
<?php
/**
* Change default country
* List of all country ISO codes: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
*
* 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
/**
* Restrict Membership Signup by Email Domain & Level
* Make sure to edit the $valid_domains array defined further below
* to include only the domains you'd like to allow.
*
* Add this code to a custom plugin. More info: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_registration_checks_restrict_email_addresses( $value ) {
@michaelbeil
michaelbeil / pmpro_change_pay_by_check.php
Last active September 20, 2022 18:29 — forked from travislima/pmpro_change_pay_by_check.php
Change "Pay by Check" to "Pay by Bank Transfer"
<?php
/**
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
* A simple gist that changes "Pay by Check" to "Pay by Bank Transfer".
* Copy the code below into your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Pay by Check' :
@michaelbeil
michaelbeil / date-format-for-pmpro-email-variables.php
Last active August 23, 2022 15:14 — forked from ipokkel/date-format-for-pmpro-email-variables.php
Set a custom date format for the PMPro email date related variables that overrides the site's default date format.
<?php
/**
* Set a custom date format for some PMPro date email data variables.
*
* Set your custom date format in the $date_format variable.
* See https://www.php.net/manual/en/datetime.format.php for more information.
*
* 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.