Skip to content

Instantly share code, notes, and snippets.

View kimcoleman's full-sized avatar

Kim Coleman kimcoleman

View GitHub Profile
@kimcoleman
kimcoleman / my_pmpro_email_template_header_footer.php
Created August 9, 2020 16:51
Apply the Email Header and Email Footer as set in the Memberships > Email Templates admin page to the WP New User Notification.
@kimcoleman
kimcoleman / my_pmpro_membership_level_exactmetrics_frontend_tracking_options_analytics_end.php
Last active April 8, 2021 18:27
Update to the GADWP / ExactMetrics Lite tracking code for custom dimension for Membership Level
<?php
/**
* Update to the GADWP / ExactMetrics Lite tracking code for custom dimension for Membership Level
*
*/
function my_pmpro_membership_level_exactmetrics_frontend_tracking_options_analytics_end( $options ) {
// Get the value to track for the current user.
if ( is_user_logged_in() && function_exists( 'pmpro_getMembershipLevelForUser' ) ) {
// Get the current users's membership level ID.
$current_user_membership_level = pmpro_getMembershipLevelForUser( get_current_user_id() );
@kimcoleman
kimcoleman / pmpro_sample_advanced_levels_compare_table.html
Last active August 9, 2020 14:15
pmpro_sample_advanced_levels_compare_table.html
[pmpro_advanced_levels layout='compare_table' compare='<a href="/item-1/">Item 1</a>,1,1;<a href="/item-2/">Item 2</a>,0,1']
@kimcoleman
kimcoleman / show_today_date_before_pmpro_tos_content.php
Last active March 28, 2021 00:27
Show today's date before the content of the Terms of Service page at Membership Checkout.
<?php
/**
* Show today's date before the content of the Terms of Service page at Membership Checkout.
*
* 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/
*
*/
@kimcoleman
kimcoleman / login_redirect_to_referrer.php
Created July 30, 2020 13:39
Always redirect user to referrer after log in if no other redirects are set.
<?php
/**
* Always redirect user to referrer after log in if no other redirects are set.
*
*/
function login_redirect_to_referrer( $redirect_to, $request, $user ) {
// If already redirecting, do that.
if ( ! empty( $redirect_to ) ) {
return $redirect_to;
@kimcoleman
kimcoleman / remove_the_pmpro_actions_nav_separator.php
Last active March 30, 2021 03:43
Remove the vertical bar | in the various action nav groups on Membership Account, Log In widget, and more.
<?php
/**
* Remove the vertical bar | in the various action nav groups on Membership Account, Log In widget, and more.
*
* 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/
*
*/
@kimcoleman
kimcoleman / just_states_pmprorh_init.php
Created July 25, 2020 13:31
Custom fields at membership checkout for just state.
<?php
/**
* Custom fields at membership checkout for just state.
*
*/
function just_states_pmprorh_init() {
global $pmpro_states;
//don't break if Register Helper is not loaded
if(!function_exists("pmprorh_add_registration_field"))
@kimcoleman
kimcoleman / butlercountyogs_pmprorh_init.php
Created July 25, 2020 13:03
Custom fields at membership checkout for support ticket.
<?php
/**
* Custom fields at membership checkout for support ticket.
*
* Requires: Paid Memberships Pro, Register Helper 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/
@kimcoleman
kimcoleman / pmpro-stripe-custom-css.css
Created July 17, 2020 14:14
The default Stripe gateway checkout styles in frontend.css of Paid Memberships Pro version 2.3.4
/* Stripe gateway Membership Checkout specific styles. */
.pmpro_checkout_gateway-stripe form.pmpro_form #pmpro_payment_information_fields .pmpro_checkout-fields,
.pmpro_billing_gateway-stripe form.pmpro_form #pmpro_payment_information_fields .pmpro_checkout-fields {
display: -ms-grid;
display: grid;
-ms-grid-rows: auto 1em auto 1em auto;
grid-template-areas:
"AccountNumber AccountNumber"
"Expiry CVV"
"DiscountCode DiscountCode";
@kimcoleman
kimcoleman / my_pmprorh_init_user_avatar.php
Last active January 20, 2022 15:46
Allow members to upload their avatar using a Register Helper field during checkout or on the Member Profile Edit page.
<?php
/*
* Allow members to upload their avatar using a Register Helper field during checkout or on the Member Profile Edit page.
*
* Requires: Paid Memberships Pro, Register Helper 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/