Skip to content

Instantly share code, notes, and snippets.

<?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 / pmpro-cpt.php
Last active June 19, 2023 22:44 — forked from ideadude/pmpro-cpt.php
Add the PMPro meta box to a CPT. Add this to your plugin/etc.
<?php
/**
* Add the PMPro meta box to a CPT
*
* 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/
*/
function my_add_pmpro_meta_box_to_cpts() {
@michaelbeil
michaelbeil / change-text-or-translate-with-gettext.php
Last active May 26, 2023 01:10 — forked from ipokkel/change-text-or-translate-with-gettext.php
Change password reset text with the gettext filter
<?php
/**
* This recipe changes text with the gettext filter.
* Can be used to change text or translate specific text strings.
*
* 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 / my_approve_user_if_already_approved.php
Last active May 24, 2023 22:09 — forked from ideadude/my_approve_user_if_already_approved.php
PMPro Approvals: If a user was approved for any other level, consider them approved for every level.
<?php
/**
* If a user was approved for any other level, consider them approved for every level.
* Requires the PMPro Approval Process for Membership Add On - https://www.paidmembershipspro.com/add-ons/approval-process-membership/
* Must be using PMPro Approvals version 1.4.2 or higher.
* Add this code to your site following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_approve_user_if_already_approved( $approved, $user_id, $level_id, $user_approval ) {
@michaelbeil
michaelbeil / mypmro-change-username-text.php
Last active April 28, 2023 16:37 — forked from JarrydLong/mypmro-change-username-text.php
Change the default Username text to First and Last Name Only
<?php
/**
* This recipe will change the default Username text to First and Last Name Only
*
* 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'
@michaelbeil
michaelbeil / redirect-users-to-membership-level-homepage.php
Last active April 21, 2023 16:35
Redirect members to their membership level homepage after logging in
<?php
/**
* Redirect members to their membership level homepage after logging in.
*
* 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 / my_gettext_pay_by_check.php
Last active April 20, 2023 18:19 — forked from MaryOJob/my_gettext_pay_by_check.php
Update Pay by Check wording to something else.
<?php
/**
* This recipe changes the "Pay by Check" language
*
* 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.
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
* @link https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@michaelbeil
michaelbeil / custom_pmproeewe_email_frequency.php
Last active March 27, 2023 19:33 — forked from kimcoleman/custom_pmproeewe_email_frequency.php
Filter the settings of email frequency when using the Extra Expiration Warning Emails Add On
<?php
/**
* Filter the settings of email frequency sent when using the Extra Expiration Warning Emails Add On
* https://www.paidmembershipspro.com/add-ons/extra-expiration-warning-emails-add-on/
*
* Update the $settings array to your list of number of days => ''.
* Read the Add On documentation for additional customization using this filter.
*/
function custom_pmproeewe_email_frequency( $settings = array() ) {
@michaelbeil
michaelbeil / hide-pmpro-username.css
Last active March 24, 2023 20:06 — forked from travislima/hide-pmpro-username.css
Hide the Paid Memberships Pro Username field using CSS
/*
*
* The following CSS code will hide the PMPro username field.
* Add this CSS to Simple Custom CSS and JS: https://wordpress.org/plugins/custom-css-js/
* Code Recipe intended to be used along with the following gist: https://github.com/strangerstudios/pmpro-snippets-library/blob/dev/checkout/name-email-only-checkout.php
*
*/
.pmpro_checkout-field-username {
display: none;