Skip to content

Instantly share code, notes, and snippets.

View femiyb's full-sized avatar
🏠
Working from home

Femi YB femiyb

🏠
Working from home
View GitHub Profile
@femiyb
femiyb / my_pmpro_replace_mail_emailandusername.php
Last active June 21, 2021 07:34 — forked from MaryOJob/my_pmpro_replace_mail_emailandusername.php
Replace "Email Address" with "Username or Email Address" on PMPro Login Form
<?php // Do not copy this line please. Copy from below.
/**
* This filter will search your codebase for translatable strings and replace when an exact match is found.
* Replace "Email Address" with "Username or Email Address" on PMPro Login Form
* Add this code to your PMPro Customizations Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
add_filter( 'the_content', 'register_text', 25 );
@femiyb
femiyb / sequential-numeric-member-number.php
Last active August 12, 2021 17:24 — forked from ipokkel/sequential-numeric-member-number.php
Create sequential membership numbers. Display on user account page, edit profile page,memberslist page and membership card and include in memberslist csv export.
<?php
/**
* Sequential Member Numbers
* Member numbers are automatically increased from the value set for $starting_member_number after each member registration
*
* Add this code to your PMPro Customizations Plugin
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*
* Requirements:
@femiyb
femiyb / hide_discount_code_checkout.php
Created June 8, 2021 15:20 — forked from andrewlimaza/hide_discount_code_checkout.php
Hide Discount Code For PMPro Level
<?php
/**
* Hide discount code link on checkout for a specific level Paid Memberships Pro.
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Visit www.paidmembershipspro.com for more info.
*/
function pmpro_hide_discount_level_5() {
global $pmpro_pages;
@femiyb
femiyb / pmpro_move_name_fields.php
Created June 2, 2021 09:05 — forked from MaryOJob/pmpro_move_name_fields.php
This Code Gist Will Move the Fields in this order, First Name, Last Name, Email Address and Password When using the Code to Generate a username at PMPro checkout from email for users and hiding the username field with CSS - Links for this below
<?php // Do not Copy This Line
/**
* Add the following code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function pmpro_move_name_fields() {
global $pmpro_pages;
?>
<script>
@femiyb
femiyb / disable-cf7-recaptcha.php
Created June 2, 2021 08:40 — forked from ipokkel/disable-cf7-recaptcha.php
Disable Contact Form 7's recaptcha on the checkout page for PMPro. #pmpro #paid-memberships-pro #wpcf7 #cf7 #recaptcha
<?php
/**
* This recipe stops Contact Form 7's recaptcha javascript from loading
* on the PMPro checkout page. This helps prevent conflicts from recaptcha
* being loaded twice.
*
* 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/
@femiyb
femiyb / pmpro_csv_export_add_views_column.php
Last active May 31, 2021 07:36 — forked from dparker1005/pmpro_csv_export_add_views_column.php
Adds content from Visits, Views, and Logins report to Member List to CSV export.
<?php
// Copy from below here...
/*
* Adds content from Visits, Views, and Logins report to Member List to CSV export.
*
* Here is where all the columns in the Visits, Views, and Logins report are filled
* in case you would like to customize this Gist:
* https://github.com/strangerstudios/paid-memberships-pro/blob/c3129bfce929bb4f5e7dd03f5efd74c209a5530e/adminpages/reports/login.php#L215-L252
@femiyb
femiyb / pmpro-after-expiration-change-membership-levels-adjusted.php
Last active November 1, 2021 06:53 — forked from pbrocks/pmpro-after-expiration-change-membership-levels-adjusted.php
Change PMPro membership level upon expiration or cancellation to different respective levels based on member's previous level.
<?php // do not copy to Customizations plugin
/**
* After expiration, assign them a specific "cancelled" level.
*
* Can be used to downgrade someone to a free level when they cancel.
* Will allow members to the "cancel level" to cancel from that though.
*/
function pmpro_upon_expiration_change_membership_levels( $level_id, $user_id ) {
// set this to the id of the original level
$last_level_2 = 2;
@femiyb
femiyb / pmpro-after-expiration-change-membership-levels.php
Last active May 24, 2021 06:52 — forked from pbrocks/pmpro-after-expiration-change-membership-levels.php
Change PMPro membership level upon expiration or cancellation to different respective levels based on member's previous level.
<?php
/**
* When users cancel (are changed to membership level 0) we give them another "cancelled" level.
* Can be used to downgrade someone to a free level when they cancel.
* Will allow members to the "cancel level" to cancel from that though.
*/
function pmpro_after_expiration_change_membership_levels( $level_id, $user_id ) {
// set this to the id of the level you want to give members when they cancel
$last_level_3 = 3;
$last_level_8 = 8;
@femiyb
femiyb / Generate username.php
Created May 17, 2021 16:26 — forked from andrewlimaza/Generate username.php
Generate username from firstname and last name PMPro.
<?php
/**
* This requires billing fields to be enabled at checkout.
* Generate a username from firstname and lastname fields. If name exists will try to generate a random number after the username.
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_generate_username_at_checkout() {
//check for level as well to make sure we're on checkout page
@femiyb
femiyb / gist:7ab0435b13fc56131377568bd8ab33d7
Last active April 20, 2021 10:13 — forked from ecline888/gist:c49e29aa60aea35bb4c35c8c0b51e4a0
Add billing address at checkout PaidMemberships Pro
<?php
/**
* This recipe will add billing fields to the checkout. Useful for payment gateways
* that don't have the option to display billing 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/
*/