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 / pmprosd_prorate_delay.php
Last active March 16, 2021 12:26 — forked from kimwhite/pmprosd_prorate_delay.php
Custom proration for a level with a subscription delay until a specified date (like "Y1-08-01"). Requires Paid Memberships Pro and Subscription Delays Add On.
<?php
/**
* This recipe will add custom proration for levels with a subcription delay
* until a specified date (like "Y1-08-01").
* Prorates initial payment based on days until end of subscription delay for level 1
*
* 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.
@femiyb
femiyb / 1-translate-pay-by-check-pmpro.php
Last active March 15, 2021 08:09 — forked from andrewlimaza/1-translate-pay-by-check-pmpro.php
Translating "Pay by Check" example for Paid Memberships Pro.
<?php
/**
* This will translate "Pay by Check" into "Pay by Cheque or Bank Transfer"
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* For more help visit www.paidmembershipspro.com
*/
function my_pmpro_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Pay by Check' :
@femiyb
femiyb / pmpro-adjust-the-join-now-login.php
Last active April 8, 2022 15:45 — 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://www.thefixxsquad.stylefixxdaily.com/pricing/">' . __( 'Join Now', 'paid-memberships-pro' ) . '</a>';
return $links;
}
add_filter( 'pmpro_login_forms_handler_nav', 'my_pmpro_custom_join_now_link', 10, 2 );
function my_pmprorh_init() {
// Don't break if Register Helper is not loaded.
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) {
return false;
}
// Define the fields.
$fields = array();
$fields[] = new PMProRH_Field(
'machineId', // input name, will also be used as meta key
@femiyb
femiyb / my_pmpro_change_text_example.php
Last active March 25, 2022 13:57 — forked from MaryOJob/my_pmpro_change_text_example.php
PMPro - Change "Discount Code" Text Example on Checkout Page
<?php // Do Not Copy This Line
/**
* This recipe will help you change text on the checkout paid in PMPro
* 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
function pmproc_change_my_text( $translated_text, $text, $domain ) {
@femiyb
femiyb / pmpro-dont-require-billing-fields.php
Last active March 1, 2021 15:02 — forked from ipokkel/pmpro-dont-require-billing-fields.php
Remove the Phone field from the required billing fields for PMPro checkout.
<?php
/**
* This recipe can be used to remove the Phone and Address 2 fields
* from the required billing fields for checkout.
*
* Note: Make sure your Gateway doesn't require it also.
*
* 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.
@femiyb
femiyb / my_pmpro_disable_email_template_per_level.php
Created March 1, 2021 14:59 — forked from MaryOJob/my_pmpro_disable_email_template_per_level.php
Disable member email for a specific email template for a specific level
<?php // Do Not Copy This Line
/**
* The function below will disable the membership expiring email (for a specific membereship level)
* sent to the Member/User by Paid Memberships Pro.
* The admin emails will still be sent as intended.
* 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 / hide_username_field.php
Created March 1, 2021 08:40
Hide Username Field
<?php
/**
* Hide Username Field.
*
*/
/**
* Unset required account fields,
<?php
/**
* This recipe will adjust shipping related text to something of your preference.
*
* 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/
*/
<?php
/**
* For more information on the Register Helper Add-on please visit https://www.paidmembershipspro.com/add-ons/free-add-ons/pmpro-register-helper-add-* checkout-and-profile-fields/
* Add the following code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
**/
function my_pmprorh_init_custom_field()
{