Skip to content

Instantly share code, notes, and snippets.

@michaelbeil
michaelbeil / pmpro-bulgarian-currency.php
Last active August 17, 2022 18:19 — forked from ronalfy/pmpro-bulgarian-currency.php
Paid Memberships Pro - Bulgarian Currency
<?php
// Adds the BGN currency to currency list.
function pmpro_currencies_bulgarian( $currencies ) {
$currencies['BGN'] = __( 'Bulgarian Lev', 'pmpro' );
return $currencies;
}
add_filter( 'pmpro_currencies', 'pmpro_currencies_bulgarian' );
@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.
<?php //do not copy
/**
* This recipe lock members into their existing membership.
* They won't be able to cancel or sign up for a different membership level.
*
* Change lines 21 and 45 to the level ID that requires you to be locked in.
*
* If you don't want to prevent them from cancelling, comment out line 30 with //
*
* You can add this recipe to your site by creating a custom plugin
@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' :
<?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 / 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.
@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 / 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];
<?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-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
*/
/*