Skip to content

Instantly share code, notes, and snippets.

View MaximilianoRicoTabo's full-sized avatar

Maximiliano Rico MaximilianoRicoTabo

  • -
  • Montevideo - La Paloma
  • 04:33 (UTC -03:00)
View GitHub Profile
<?php // do not copy this line.
/**
* This recipe does will change the price for a membership by the date
*
* 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 pmpro_checkout_sale_price( $level ) {
@MaximilianoRicoTabo
MaximilianoRicoTabo / my-sponsor-area-account-pages.php
Last active August 16, 2024 12:58 — forked from kimwhite/my-sponsor-area-account-pages.php
This recipe remove the default code that adds the sponsor area to membership account page ( forked and adapted to v3.1 UI )
<?php
/**
* This recipe remove the default code that addes the sponsor area to membership account page
* Needed when using WPML
*
* 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/
@MaximilianoRicoTabo
MaximilianoRicoTabo / added-member-custom-email.php
Last active June 17, 2024 21:10 — forked from andrewlimaza/added-member-custom-email.php
Custom Email when a Member change its level
<?php
/**
* Send an email to the admin when a user changes its level.
*
* @param int $level_id The ID of the new level.
* @param int $user_id The ID of the user.
*
*/
function custom_pmpro_after_change_membership_level( $level_id, $user_id ) {
//Bail if level_id is 0
@MaximilianoRicoTabo
MaximilianoRicoTabo / pmpro-sponsored-members-assign-to-parent.php
Last active May 1, 2024 18:09 — forked from kimcoleman/pmpro-sponsored-members-assign-to-parent.php
Retroactively assign a user to a Parent account when using the Sponsored Members Add On.
<?php
/**
* Retroactively assign a user to a Parent account when using the Sponsored Members Add On.
* Enter the user ID of parent account in the "Assign to Parent Account" on the "Edit Profile" screen.
* This gist assume user being edited has an active membership and it's a sponsored level.
*
* Note: The user's active Membership Level must be the correct "Child" level for that Parent/Child relationship.
*
*/
function pmprosm_assign_child_members( $profileuser ) {
@MaximilianoRicoTabo
MaximilianoRicoTabo / generate-username-from-first-and-last-name-pmpro.php
Last active October 19, 2023 17:37 — forked from andrewlimaza/generate-username-from-email-pmpro.php
Generate a username during checkout for user [Paid Memberships Pro]
<?php
/**
* Generate a username at PMPro checkout from first and last name for users.
* Hide your 'username' field using custom CSS.
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_generate_username_at_checkout() {
//check for level as well to make sure we're on checkout page
@MaximilianoRicoTabo
MaximilianoRicoTabo / load-custom-css-level-pmpro.php
Last active July 24, 2023 15:51 — forked from kimwhite/load-custom-css-level-pmpro.php
Load custom CSS for Membership Checkout page - Paid Memberships Pro
<?php
/**
* Load custom CSS on checkout page in Paid Memberships Pro.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function load_css_for_level_checkout(){
global $pmpro_pages;
// Change your membership level ID here.
@MaximilianoRicoTabo
MaximilianoRicoTabo / custom-level-confirmation-message-for-pmpro-approvals.php
Last active July 14, 2023 19:47 — forked from ipokkel/custom-level-confirmation-message-for-pmpro-approvals.php
Keep the custom messages set for each level under Membership >> Membership Levels and combine it with the PMPro Approvals status.
<?php
/**
* Create a custom confirmation for Approvals 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/
*/