This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# ============================================================== | |
# Plugin Language File Creator | |
# Author: Theunis Coetzee (ipokkel) | |
# | |
# This file must be placed inside the /plugin-folder/language/ folder | |
# | |
# Excecute from plugin root folder with ". languages/make-pot.sh" | |
# Check if executed from root, if not moves up one folder and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This recipe will prevent members and users who has had a membership before | |
* from checking out for a specific level. | |
* | |
* 1. Hides level on the Membership Levels page | |
* 2. Redirect back to levels page if user visits checkout page. | |
* 3. Checks on checkout that user neither has nor had the level. | |
* | |
* This is an advanced customization recipe that may require further development |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 = '[email protected]'; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Copy from below here... | |
/* | |
* Creates a log at /paid-memberships-pro/logs/level-change.txt for whenever a membership | |
* level is changed. | |
*/ | |
function my_pmpro_after_change_membership_level_log( $level_id, $user_id, $cancel_level ) { | |
$logstr = "Logged On: " . date_i18n("m/d/Y H:i:s") . "\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Copy from below here... | |
/** | |
* Add a "Birthday" field via Register Helper. | |
*/ | |
function my_pmprorh_init() { | |
//don't break if Register Helper is not loaded | |
if(!function_exists( 'pmprorh_add_registration_field' )) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This recipe is an example of how to create custom Register Helper checkout boxes, | |
* add a description to be displayed below the title, and | |
* set the order in which these checkout boxes are arranged, | |
* and create custom registration fields that are published in these custom checkout boxes | |
* on the membership registration form. | |
* | |
* @requires Register Helper Add On | |
* @link https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // do not copy | |
/** | |
* This recipe will add a Description field to each discount code. This is then visible on the | |
* Discount Codes page for admin reference. | |
* | |
* 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/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This recipe will allow you to control content with all membership levels. | |
* | |
* 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/ | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add a checkbox to frontend login page of WordPress to toggle the password text visible/hidden. | |
* | |
* Add this code to a custom plugin or Code Snippets Add On: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Source: https://www.w3schools.com/howto/howto_js_toggle_password.asp | |
*/ | |
function my_pmpro_show_password_login_toggle( $items, $args ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This recipe will hide the discount code field on the checkout page if no discount codes | |
* have been created for that specific 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/ | |
*/ |