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 / 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 );
@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 / gist:f527c23ce48e4d29bef69d61d2b69517
Created February 10, 2022 13:13 — forked from InpsydeNiklas/gist:8bf70de406a2ff8afef3aa7c2fcff7ac
List of available hooks for PayPal Payments smart buttons
woocommerce_paypal_payments_checkout_button_renderer_hook
woocommerce_paypal_payments_checkout_dcc_renderer_hook
woocommerce_paypal_payments_pay_order_dcc_renderer_hook
woocommerce_paypal_payments_proceed_to_checkout_button_renderer_hook
woocommerce_paypal_payments_mini_cart_button_renderer_hook
woocommerce_paypal_payments_single_product_renderer_hook
@femiyb
femiyb / my-pmpro-change-seat-to-student.php
Last active January 13, 2022 19:33 — forked from andrewlimaza/my-pmpro-change-seat-to-member.php
Change the word "Seat(s)" to "student(s)" for Paid Memberships Pro Sponsored Members Add On.
<?php
/**
* This will change all instances of seat(s) to student(s) for the Sponsored Members Add On - https://www.paidmembershipspro.com/add-ons/pmpro-sponsored-members/
* Add the code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_change_seat_to_student( $output_text, $input_text, $domain ) {
if ( 'pmpro-sponsored-members' === $domain ) {
$output_text = str_replace( 'seats', 'students', $output_text );
$output_text = str_replace( 'Seats', 'Students', $output_text );
@femiyb
femiyb / my_pmpro_email_headers_bcc.php
Created July 17, 2020 15:34 — forked from strangerstudios/my_pmpro_email_headers_bcc.php
BCC a second email address on PMPro admin emails.
/*
Add bcc for PMPro admin emails.
Change otheremail@domain.com,anotheremail@domain.com below to the addresses you want to use.
Add this code to your active theme's functions.php or a custom plugin
a la http://www.paidmembershipspro.com/2012/08/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_email_headers_bcc($headers, $email)
{
//bcc emails going to admins
if(strpos($email->template, "admin") !== false)
@femiyb
femiyb / pmpro-prorate-initial-payment.php
Created September 11, 2020 11:31 — forked from greathmaster/pmpro-prorate-initial-payment.php
Prorate the initial payment. Useful for subscriptions that occur on the first of every month.
function my_pmpro_checkout_level($level)
{
$current_day = date('j');
$days_in_month = date('t');
$level->initial_payment = $level->initial_payment*(($days_in_month - $current_day)/$days_in_month);
return $level;
}
@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 / App.css
Created October 3, 2021 18:25 — forked from adrianhajdin/App.css
/* CHAT STYLES */
* {
font-family: Avenir, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji,
Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
letter-spacing: 0.5px;
}
.ce-chat-list {
background-color: rgb(240, 240, 240) !important;
@femiyb
femiyb / my_pmpro_always_show_renew_levels.php
Created July 30, 2020 21:11 — forked from LMNTL/my_pmpro_always_show_renew_levels.php
Always show renew links for certain PMPro levels if the member already has that level.
// always show renew links for certain levels if the member already has that level.
function my_pmpro_always_show_renew_levels( $show, $level ){
/*--- change this line to the levels you want to show a renew link---*/
$show_levels = array( 1, 2 );
if( in_array( $level->id, $show_levels ) ) {
$show = true;
}
@femiyb
femiyb / custom_pmproeewe_email_frequency.php
Last active August 19, 2021 10:42 — forked from kimcoleman/custom_pmproeewe_email_frequency.php
Filter the settings of email frequency when using the Extra Expiration Warning Emails Add On
<?php
/**
* Filter the settings of email frequency sent when using the Extra Expiration Warning Emails Add On
* https://www.paidmembershipspro.com/add-ons/extra-expiration-warning-emails-add-on/
*
* Update the $settings array to your list of number of days => ''.
* Read the Add On documentation for additional customization using this filter.
*/
function custom_pmproeewe_email_frequency( $settings = array() ) {