Skip to content

Instantly share code, notes, and snippets.

Avatar

Theuns Coetzee ipokkel

View GitHub Profile
@ipokkel
ipokkel / my-show-user-enddate.php
Last active Nov 16, 2020 — forked from kimwhite/my-show-user-enddate.php
Custom shortcode to show member expiration dates or recurring. [show_enddate]
View my-show-user-enddate.php
<?php
/**
* Show the user's expiration date, or their next payment date.
* [show_enddate] ( show end date, show enddate, show_endate )
* Show the user's previously expired date if they were cancelled, expired or cancelled by an admin.
* If none of thhe above is found, the string 'nothing found' will be returned.
*
* 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.
@ipokkel
ipokkel / my-show-user-start.php
Last active Nov 16, 2020 — forked from femiyb/my-show-user-start.php
Show the user's start date.
View my-show-user-start.php
<?php
/**
* Show the user's start date.
* Show the user's previously membership start date if they were cancelled, expired or cancelled by an admin.
* If none of thhe above is found, the string 'nothing found' will be returned.
*/
function my_show_user_startdate() {
if ( is_user_logged_in() && function_exists( 'pmpro_hasMembershipLevel' ) && pmpro_hasMembershipLevel() ) {
View pmpro-add-custom-fields-to-email.php
<?php
/**
* This recipe Adds !!company!! as an available variable for use in Paid Memberships Pro emails.
* When the variable is empty it will display nothing instead of the !!company!! email variable
*
* Notice the array key does not include the !!s
*
* 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.
View Change Text on Membership Levels
/**
* This filter will search your codebase for translatable strings and replace when an exact match is found.
*
* Here we're changing 'Membership' to 'Subscription' for Paid Memberships Pro.
*
* Add this code to your PMPro Customizations Plugin
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Note: When adding to your Customizations Plugin, be careful not to include the opening php tag on line 1 above.
*
* @param string $output_text this represents the end result
@ipokkel
ipokkel / pmpro-one-time-signup-fee.php
Last active Sep 25, 2020 — forked from kimwhite/pmpro-one-time-signup-fee.php
This recipe will allow you to charge additional extras on the user's fee. #pmpro #checkout
View pmpro-one-time-signup-fee.php
<?php
/**
* This recipe will allow you to charge additional extras on the user's fee.
*
* 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-redirect-to-user-page.php
Last active Nov 9, 2020 — forked from strangerstudios/pmpro-redirect-to-user-page.php
Plugin to work with PMPro and PMPro User Pages to redirect someone to their latest user page on login.
View pmpro-redirect-to-user-page.php
<?php
/**
* This recipe redirects members to their User Page on login
* and non-members to the PMPro membership levels page.
*
* This recipe assumes the User Pages Add On is installed and configured.
* @link https://www.paidmembershipspro.com/add-ons/pmpro-user-pages/
*
* 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.
@ipokkel
ipokkel / remove-shipping-phone-field-pmpro.php
Last active Jun 25, 2020 — forked from andrewlimaza/remove-shipping-phone-field-pmpro.php
Remove shipping phone field from PMPro checkout
View remove-shipping-phone-field-pmpro.php
<?php
/**
* This recipe makes the shipping phone field, sphone, optional and hides the field on the checkout form.
* default user account email on renewal.
*
* 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 / disable-recurring-payment-reminder.php
Last active Jun 17, 2020 — forked from andrewlimaza/change-recurring-payment-reminder.php
Disable a recurring payment reminder email preventing it from being sent for Paid Memberships Pro.
View disable-recurring-payment-reminder.php
<?php
/**
* This recipe removes a specific recurring payment reminder.
*
* 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_pmpro_disable_recurring_emails( $emails ) {
@ipokkel
ipokkel / make_old_posts_free.php
Last active May 28, 2020 — forked from strangerstudios/make_old_posts_free.php
Make any post older than 18 months available for free with Paid Memberships Pro.
View make_old_posts_free.php
<?php
/**
* This recipe allows non-members to view specific restricted posts
* if they are older than the amount of days specified per post.
*
* To set which posts to unlock and their individual period (days)
* set the post id's as the array key and the period as the
* value of the array key of the $posts_to_unlock variable.
*
@ipokkel
ipokkel / open_specific_new_posts_to_non_members.php
Last active May 25, 2020 — forked from strangerstudios/open_new_posts_to_non_members.php
PMPro Customizations to allow non-members to view specified restricted posts if they are less than 30 days old.
View open_specific_new_posts_to_non_members.php
<?php
/**
* This recipe allows non-members to view specific restricted posts
* if they are less than 30 days old.
*
* To set which posts to unlock set the post id's in the array of
* the $posts_to_unlock variable
* Change the '-30 Days' below if you'd like to allow access for longer or shorter.
*
* You can add this recipe to your site by creating a custom plugin
You can’t perform that action at this time.