Skip to content

Instantly share code, notes, and snippets.

View ipokkel's full-sized avatar

Theuns Coetzee ipokkel

View GitHub Profile
@ipokkel
ipokkel / change-register-memberlite-theme.php
Created February 5, 2025 12:16 — forked from andrewlimaza/change-register-memberlite-theme.php
Change "Register" to "Sign Up" in Memberlite WordPress theme.
<?php
/**
* Change 'Register' wording in Memberlite theme to 'Sign Up'
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_change_memberlite_wording( $translated_text, $text, $domain ) {
switch( $translated_text ) {
case 'Register':
$translated_text = __( 'Sign Up', 'memberlite' );
break;
<?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/
*/
@ipokkel
ipokkel / pmpro-adjust-the-join-now-login.php
Last active February 27, 2024 10:51 — forked from andrewlimaza/pmpro-adjust-the-join-now-login.php
Adjust the Paid Memberships Pro login "Join Now" Link.
<?php
/**
* Adjust the 'Join Now' link on the login page to a custom URL for Paid Memberships Pro.
* Follow this guide to add custom code to your membership site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_custom_join_now_link( $links, $allowed_html ) {
$links['register'] = '<a href="https://example.com/join-now/">' . __( 'Join Now', 'paid-memberships-pro' ) . '</a>';
return $links;
}
add_filter( 'pmpro_login_forms_handler_nav', 'my_pmpro_custom_join_now_link', 10, 2 );
@ipokkel
ipokkel / my_pmpro_change_text_example.php
Last active August 1, 2022 07:34
PMPro - Change Text Example on Checkout Page by LEVEL
<?php // Do Not Copy This Line
/**
* This recipe will help you change text on the checkout paid by 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/
*/
// paste content from below this line
@ipokkel
ipokkel / my-pmpro-redirect-to-referring-page-after-checkout.php
Last active December 12, 2024 07:03 — forked from sc0ttkclark/my-pmpro-redirect-to-referring-page-after-checkout.md
Redirect new members and existing members that changes their existing level back to the referring page after checkout.
<?php
/**
* Updated with https://gist.github.com/ipokkel/fdfeb10a8120777661fbef4e8ed80fa0
* This gist is kept for archival purposes, use the updated one above please.
*/
@ipokkel
ipokkel / my-pmpro-custom-order-code-with-date.php
Last active September 6, 2021 10:28 — forked from andrewlimaza/custom-pmpro-order-codes.php
Generate custom order codes / order numbers that increment for Paid Memberships Pro Orders [Date + Custom order sequence]
<? php
/**
* Custom order codes for Paid Memberships Pro Orders.
*
* This code will take the date and order ID and create
* an order code from that such as "INV060920211", "INV060920212", "INV060920213"
* and increment with each order added.
*
* A fallback is in place that if "INV060920211" already exists for some order,
* it will just generate a random code to be safe.
@ipokkel
ipokkel / reset-pmpro-visits-views-logins.php
Created August 30, 2021 09:22 — forked from andrewlimaza/reset-pmpro-visits-views-logins.php
Reset visits, views and logins for Paid Memberships Pro.
<?php
/**
* Add &pmpro_reset_analytics=1 to your WordPress dashboard URL/Paid Memberships Pro reports page.
* Add this code to your Code Snippets / Custom Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* You may remove this code from your site when you don't need it any longer.
*/
function my_pmpro_reset_visit_data() {
// Check if URL parameter pmpro_reset_analytics is set
if ( isset( $_REQUEST['pmpro_reset_analytics'] ) ) {
@ipokkel
ipokkel / restrict-all-pages-non-members.php
Last active October 3, 2023 15:31 — forked from andrewlimaza/restrict-all-pages-non-members.php
Restrict all pages except home, Paid Memberships Pro pages, and specific pages for non-members.
<?php
/**
* This recipe will restrict all pages except Paid Memberships Pro pages,
* or the home page of your website, the search results page, the 404 page, or defined post/pages to non-members,
* non-approved members, or logged-out users.
*
* This won't affect administrators.
*
* 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 / my_first_last_display_name.php
Last active April 16, 2021 05:45 — forked from kimcoleman/my_first_last_display_name.php
Set Display Name on Membership Checkout and for BuddyPress Name field.
<?php
/**
* Set Display Name on Membership Checkout and for BuddyPress Name field.
*/
function my_first_last_display_name( $user_id, $morder ) {
// Get user's first and last name.
$first_name = get_user_meta( $user_id, 'first_name', true );
$last_name = get_user_meta( $user_id, 'last_name', true );
@ipokkel
ipokkel / my_pmprorh_init_user_avatar.php
Last active March 10, 2021 22:48 — forked from kimcoleman/my_pmprorh_init_user_avatar.php
Allow members to upload their avatar using a Register Helper field during checkout or on the Member Profile Edit page.
<?php
/*
* Allow members to upload their avatar using a Register Helper field during checkout or on the Member Profile Edit page.
*
* Requires: Paid Memberships Pro, Register Helper Add On.
*
* 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/