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
@MaximilianoRicoTabo
MaximilianoRicoTabo / custom_query.sql
Created August 26, 2024 19:20
Get users from DB filtered by a checkbox user field
SELECT
u.ID as UserID,
u.user_login as Username,
u.user_email as Email,
u.user_registered as RegisteredDate,
um.meta_value as CommitteeMemberStatus
FROM
wp_users u
JOIN
wp_usermeta um
@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 / example_code.php
Created August 15, 2024 20:51
Example of how to get Order code in confirmation page
<?php
add_action('init', 'pmpro_example_code');
function pmpro_example_code() {
?>
<script>
document.addEventListener('DOMContentLoaded', function() {
const code = pmpro.code;
console.log(code);
});
@MaximilianoRicoTabo
MaximilianoRicoTabo / hide-state-from-billing-address.php
Created August 14, 2024 16:32
hide state from billing address
<?php
/**
* Hide the billing state field on the checkout and billing pages.
*/
function wp_head_hide_billing_state_field() {
global $pmpro_pages;
if ( empty( $pmpro_pages ) || ( ! is_page( $pmpro_pages['checkout'] ) && ! is_page( $pmpro_pages['billing'] ) ) ) {
return;
}
?>
@MaximilianoRicoTabo
MaximilianoRicoTabo / format_phone_field.php
Last active August 2, 2024 19:26
Format the phone field to look like (###) ###-####
<?php
/**
* Format the phone field to look like (###) ###-####
* link: TBD
*
* 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 / customize_level_cost_text.php
Last active August 2, 2024 19:13
Customize the level cost text to include the donation amount.
<?php
/**
* Customize the level cost text to include the donation amount.
* link: TBD
*
* 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 / gist:8b07679223e6fc7482a018e1caf8c6df
Last active June 21, 2024 17:48
Add grace period to users that enddate falls in august or christmas
<?php
/**
* Change enddate to a date that is not a holiday give grace period adding more days depending the holidays days.
* link: TBD
*
* 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 / count_members_shortcode.php
Last active May 29, 2024 22:53
Create a shortcode that count members. Support pass an array of level ids
<?php
/**
*
* Create a shortcode that count members. Support pass an array of level ids, statuses array and justnumber attrs.
* link: TBD
*
* 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.
@MaximilianoRicoTabo
MaximilianoRicoTabo / make_italia_default_selected_country.php
Last active May 19, 2024 19:23
Make Italia default selected country for country and estate dropdown Add On.
<?php
function make_italia_default_selected_country() {
global $pmpro_pages;
if ( is_page( $pmpro_pages['checkout'] ) ) {
?>
<script>
//Dom ready
jQuery('document').ready(function($) {