Skip to content

Instantly share code, notes, and snippets.

@michaelbeil
michaelbeil / change-default-checkout-button-pmpro.php
Last active October 27, 2023 08:23 — forked from andrewlimaza/change-default-checkout-button-pmpro.php
Change default checkout button text for Paid Memberships Pro
<?php
/**
* Change default checkout button
* Simply change the text value to 'Submit' or whatever you like
*
* 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 / function_to_change_pmpro_donation_text.php
Last active April 25, 2023 23:21 — forked from andrewlimaza/function_to_change_pmpro_donation_text.php
Function that changes 'Make a Gift' text - PMPRO Donations Add on
<?php
/*
This function simply edits the text 'Make a Gift' for PMPRO Donations Add-On
Please paste this function in your functions.php or custom plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function pmpro_donations_change_text( $change_text, $text, $domain ) {
switch ( $change_text ) {
case 'Make a Gift' :
$change_text = __( 'Make A Legislative Contributionn', 'pmpro-donations' ); //edit 'Make A Legislative Contribution' to edit the text output of 'Make a Gift'
<?php
// Add this code below to your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
add_filter( 'gettext', 'change_my_text_example', 20, 3 );
/**
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function change_my_text_example( $translated_text, $text, $domain ) {
@michaelbeil
michaelbeil / pmpro-columns-grid-payment-method-select-checkout.css
Last active June 20, 2022 22:19 — forked from kimwhite/pmpro-columns-grid-payment-method-select-checkout.css
Custom CSS for Membership Checkout page with Payment Method Select using CSS Grid: 2 Column Layout for "Account Information" and "Billing Information" sections (with conditionals)
<?php // do not copy this line.
/**
* This recipe adds custom CSS for non-logged in users on screens larger then 768px.
*
* 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-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.
@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 ) {
<?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/
*/
@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.