Skip to content

Instantly share code, notes, and snippets.

View kimcoleman's full-sized avatar

Kim Coleman kimcoleman

View GitHub Profile
@kimcoleman
kimcoleman / pmpro-columns-grid-checkout.css
Last active August 17, 2021 13:34
Custom CSS for Membership Checkout page using CSS Grid: 2 Column Layout for "Account Information" and "Billing Information" sections.
.pmpro-checkout .pmpro_form {
display: -ms-grid;
display: grid;
grid-column-gap: 1em;
-ms-grid-columns: 1 1em 1;
grid-template-columns: 1 1;
grid-template-areas:
"message message"
"pricing pricing"
"user address"
@kimcoleman
kimcoleman / pmpro-columns-float-checkout.css
Created January 17, 2020 12:37
Custom CSS for Membership Checkout page using CSS float: 2 Column Layout for "Account Information" and "Billing Information" sections. Raw
.pmpro-checkout .pmpro_form #pmpro_user_fields {
float: left;
width: 48%;
}
.pmpro-checkout .pmpro_form #pmpro_billing_address_fields {
float: right;
width: 48%;
}
@kimcoleman
kimcoleman / remove_membership_level_profile_fields_on_frontend.php
Created January 21, 2020 21:12
Remove the "Membership Level" Edit Section from User Profile Edit if viewing the Profile from the frontend using a plugin like Theme My Login's Profiles Module.
<?php
/**
* Remove the "Membership Level" Edit Section from User Profile Edit
* if viewing the Profile from the frontend using a plugin like
* Theme My Login's Profiles Module.
*
*/
function remove_membership_level_profile_fields_on_frontend() {
if ( ! is_admin() ) {
remove_action( 'show_user_profile', 'pmpro_membership_level_profile_fields' );
@kimcoleman
kimcoleman / add_chargeback_custom_order_status.php
Last active January 30, 2020 21:38
Add a new order status 'chargeback' to your PMPro site.
<?php
/**
* Add a new order status 'chargeback' to your PMPro site.
*
*/
function add_chargeback_custom_order_status( $statuses ) {
$statuses[] = 'chargeback';
return $statuses;
}
add_filter( 'pmpro_order_statuses', 'add_chargeback_custom_order_status' );
@kimcoleman
kimcoleman / pmpro-sponsored-members-assign-to-parent.php
Last active June 4, 2024 14:19 — forked from greathmaster/pmpro-sponsored-members-assign-to-parent.php
Retroactively assign a user to a Parent account when using the Sponsored Members Add On.
/**
* 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.
*
* Note: The user's active Membership Level must be the correct "Child" level for that Parent/Child relationship.
*
*/
function pmprosm_assign_child_members( $profileuser ) {
if ( function_exists( 'pmprosm_getSponsor' ) && current_user_can( 'edit_users' ) ) {
@kimcoleman
kimcoleman / my_init_pmpro_mini_api.php
Last active April 3, 2021 03:51 — forked from strangerstudios/my_init_pmpro_mini_api.php
Very basic custom RESTful API to check the membership level of a Paid Memberships Pro User
<?php
/**
* Call to http://yoursite.com/?verify=email@domain.com&secret=SOMESECRETHERE to check the membership level of a user.
*/
function my_init_pmpro_mini_api() {
if ( function_exists( 'pmpro_getMembershipLevelForUser' ) &&
! empty( $_REQUEST[ 'verify' ] ) &&
! empty( $_REQUEST[ 'secret' ] ) )
{
if ( $_REQUEST[ 'secret' ] != 'SOMESECRETHERE' ) {
@kimcoleman
kimcoleman / my_default_wp_user_checkout_fields.php
Last active April 13, 2021 03:01 — forked from strangerstudios/my_default_wp_user_checkout_fields.php
Capture default user profile fields at Membership Checkout using Register Helper
<?php
/**
* Add Website and Biographical Info to Membership Checkout
*/
function my_default_wp_user_checkout_fields() {
if ( class_exists( 'PMProRH_Field') ) {
pmprorh_add_checkout_box( 'additional', 'Additional Information' );
$fields = array();
//user_url field
@kimcoleman
kimcoleman / my_memberlite_pmpro_demo_homepage.txt
Last active March 3, 2020 12:26
Memberlite and Paid Memberships Pro Demo Site: Homepage Content
<!-- Place this content in the primary post editor, change "Page Attributes > Template" to "Fluid Width" -->
[memberlite_banner background="body"][pmpro_advanced_levels back_link="0" highlight="2" layout="3col" levels="1,2,3"]
[/memberlite_banner][memberlite_banner background="secondary"]
<h1 class="text-center">Advice and Tips for Dog Lovers Everywhere.</h1>
<h3 class="text-center">Pupperino borkf ur givin me a spook heck, most angery pupper I have ever seen borkf corgo shooberino, snoot borking doggo. stop it fren.</h3>
<hr>
[memberlite_recent_posts]
<div class="text-center">[memberlite_btn href="/blog/" style="primary" text="View More Posts" icon="chevron-right"]</div>
[/memberlite_banner]
@kimcoleman
kimcoleman / append_profile_page_with_cf7.php
Last active June 9, 2022 08:28
Add Contact Form 7 to the Profile page when using the Member Directory and Profiles Add On for Paid Memberships Pro.
<?php
/**
* Add Contact Form 7 to the Profile page when using the Member Directory and Profiles Add On for Paid Memberships Pro.
* Update line 36 with the correct CF7 shortcode for your desired form to display.
* Add a hidden field to your form: "[hidden send-to-email default:shortcode_attr]".
* Set the "To" field of the Contact Form to "[send-to-email]".
*
*/
// Allow custom shortcode attribute for "send-to-email".
@kimcoleman
kimcoleman / my_pmpro_member_links.php
Last active April 10, 2023 12:51 — forked from strangerstudios/my_pmpro_member_links
Example of how to add links to the Member Links list on the Membership Account page.