Skip to content

Instantly share code, notes, and snippets.

Avatar

Theuns Coetzee ipokkel

View GitHub Profile
@ipokkel
ipokkel / toggle-payment-type-field-visibility-for-check.php
Created March 21, 2023 09:39
Show or hide (toggle) your check payment type user field group if the check payment option is selected. #pmpropbc #pmpro-pay-by-check
View toggle-payment-type-field-visibility-for-check.php
<?php
/**
* Toggle the Payment Type user field on the checkout page when using the Pay by Check gateway.
* The Payment Type field is moved to below the Choose Your Payment Method part on the checkout page.
*
* This is a partner recipe for the guide
* Let Users Select Offline Payment Methods Using the “Pay by CheckGateway
* @link https://www.paidmembershipspro.com/let-users-select-offline-payment-methods-using-the-pay-by-check-gateway/
*
* This recipe assumes the following:
View example-basic-user-avatar-alt-tag.php
<?php
/**
* Example of how to set an alt tag for Basic User Avatars when the
* alt tag is not set.
*
* 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/
*/
@ipokkel
ipokkel / pmpro-confirmation-adjust-invoice-print.css
Created February 24, 2023 07:55
Example CSS to only show the invoice for print media on the PMPro Confirmation page.
View pmpro-confirmation-adjust-invoice-print.css
@media print {
/** Hide stuff when printing **/
.pmpro-confirmation .site-header,
.pmpro-confirmation .pmpro_actions_nav,
.pmpro-confirmation nav,
.pmpro-confirmation header,
.pmpro-confirmation footer {
display:none;
}
@ipokkel
ipokkel / change-wordpress-user-meta-meta-key-name-example.sql
Created February 23, 2023 12:53
Example SQL of how to change a user meta meta key in the wp_usermeta table (note: your table prefix may differ from the default `wp_`). Always create a full database backup that you can restore to before making any changes to your database.
View change-wordpress-user-meta-meta-key-name-example.sql
UPDATE wp_usermeta SET meta_key = 'first_name' WHERE meta_key = 'first-name'
@ipokkel
ipokkel / custom-check-gateway-confirmation-message.php
Created February 13, 2023 07:58
Set a custom PMPro Confirmation Message. This example recipe include the ability to customize the confirmation message if the member checked out using the Check payment gateway.
View custom-check-gateway-confirmation-message.php
<?php
/**
* Customize the default confirmation message shown to new members.
*
* This recipe also adds a unique custom message if the Check gateway was used at checkout.
*
* 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/
@ipokkel
ipokkel / pmpro-addon-package-confirmation-url.php
Created February 13, 2023 04:10
Redirect membr back to Addon Package purchased after checkout.
View pmpro-addon-package-confirmation-url.php
<?php
/**
* Redirect member back to Addon Packages page after checkout.
*
* 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/
*/
@ipokkel
ipokkel / pmpro-user-page-link-shortcode.php
Created February 13, 2023 03:56
Shortcode to display a link to the member's User Page.
View pmpro-user-page-link-shortcode.php
@ipokkel
ipokkel / remove-gift-aid-text-from-checkout-page.php
Created February 8, 2023 12:55
Remove PMPro Gift Aid text from checkout page for specified levels in the $no_gift_aid_level_ids variable.
View remove-gift-aid-text-from-checkout-page.php
<?php
/**
* Remove the gift aid text from the checkout page for specified 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/
*/
@ipokkel
ipokkel / email-custom-cancel-template-per-level.php
Created January 26, 2023 12:58
Custom PMPro level canceled email templates per level.
View email-custom-cancel-template-per-level.php
<?php
/**
* This recipe sets a custom cancel email template and subject line per level.
*
* In this example recipe we created a custom email template for level ID's 1 & 2
* in the "email" folder inside our customization plugin's directory.
*
* Note: This recipe and the required email template folders need to be added
* to a custom plugin and will not work from a third-party plugin that adds
* php customization recipes to the site.
View pmpro-checkout-after-payment-information-fields-example.php
<?php
/**
* Example of adding content to the checkout page after the payment information fields.
*
* 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/
*/