Skip to content

Instantly share code, notes, and snippets.

Avatar

Theuns Coetzee ipokkel

View GitHub Profile
@ipokkel
ipokkel / custom-pmpro-member-shortcode-field.php
Last active Jan 22, 2021
This recipe adds a custom to the [pmpro_member] shortcode.
View custom-pmpro-member-shortcode-field.php
<?php
/**
* This recipe adds a custom to the [pmpro_member] shortcode.
*
* 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 / custom-signup-shortcode.php
Created Jan 20, 2021
Custom signup shortcode where the email fields are before the password fields.
View custom-signup-shortcode.php
<?php
/**
* This recipe creates a custom signup shortcode where the email fields are
* before the password 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/
*/
View first-billing-cycle-as-once-only-free-trial-period.php
<?php
/**
* This recipe sets the initial payment to the billing amount
* if the initial payment is 0 and the user previously belonged to
* a paid level.
*
* Using this recipe you may set the initial payment to 0 for recurring
* levels to give new (paying) members a type of "free trial" period once only.
*
* You can add this recipe to your site by creating a custom plugin
@ipokkel
ipokkel / pmpro-get-members-previous-paid-levels.php
Last active Jan 19, 2021
Helper function that returns an array of a user's previous paid membership levels.
View pmpro-get-members-previous-paid-levels.php
<?php
/**
* Helper function that returns an array of a user's previous paid
* membership levels.
*
* Set your free level ids in the $free_levels_ids array. If there are
* no free levels set this to
* $free_levels_ids = array( 0 );
*
* You can add this recipe to your site by creating a custom plugin
@ipokkel
ipokkel / pmpro-not-logged-in-text-filter-example.php
Created Jan 19, 2021
A multi-paragraph example of not-logged in text for restricted content.
View pmpro-not-logged-in-text-filter-example.php
<?php
/**
* This recipe is an example on setting a custom message for not logged in
* users when visiting a page containing restricted content.
*
* 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 / redirect-to-account-after-login-from-home.php
Created Jan 18, 2021
Redirects users to their PMPro account page on login from home page / site root. #paid-memberships-pro #login #redirect
View redirect-to-account-after-login-from-home.php
<?php
/**
* This recipe redirects users to their PMPro account page on login
* from the home page (site root).
*
* To set a referrer for the redirect_to variable for logged-out users
* refer to this article.
* https://www.paidmembershipspro.com/redirect-members-to-referrer-on-login/
*
* You can add this recipe to your site by creating a custom plugin
@ipokkel
ipokkel / my-pmpro-discount-code-text-strings.php
Created Jan 14, 2021
Change the Discount Code text strings if a specific level is in the querystring parameter of the URL #gettext
View my-pmpro-discount-code-text-strings.php
<?php
/**
* This recipe will change the Discount Code text strings if a specific
* level is specified as a querystring parameter in the URL.
*
* 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 / my-vs-tools.md
Last active Jan 12, 2021
My favourite VS Code Extensions that make my day to day tasks easier.
View my-vs-tools.md
@ipokkel
ipokkel / reorder-names-email-password-checkout-fields.php
Last active Jan 12, 2021
Reorder PMPro checkout fields to Username, First and Last Name, Email and Password. #pmpro #paid-memberships-pro #checkout
View reorder-names-email-password-checkout-fields.php
<?php
/**
* This recipe moves the checkout fields to appear in the order of
* 1. Username
* 2. First Name and Last Name
* 3. Email
* 4. Password.
*
* Email fields will be moved (always) to before password fields.
* First and Last Name fields will be moved if Add Name to Checkout, or
@ipokkel
ipokkel / load_addons_later_on_checkout.php
Created Jan 11, 2021
This recipe changes the order of some Add Ons on the checkout page by unhooking them and hooking them in at a different hook available on the checkout page. #pmpro #paid-memberships-pro #hooks #priority
View load_addons_later_on_checkout.php
<?php
/**
* This recipe changes the order of Add Ons on the checkout page.
*
* 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/
*/