Skip to content

Instantly share code, notes, and snippets.

View kimcoleman's full-sized avatar

Kim Coleman kimcoleman

View GitHub Profile
@kimcoleman
kimcoleman / show_sponsored_child_accounts_pmpro_member_profile_after.php
Created April 7, 2021 13:46
Show a list of the sponsored member accounts on the parent's profile page on the Member Directory's Profile page.
<?php
/*
* Show a list of the sponsored (child) member accounts on the parent's profile page on the Member Directory's Profile page.
*
* 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 show_sponsored_child_accounts_pmpro_member_profile_after( $pu ) {
@kimcoleman
kimcoleman / link_to_author_archive_pmpro_member_profile_after.php
Last active November 28, 2021 13:57
Show a link to the profile user's author post archive on the Member Profile page.
@kimcoleman
kimcoleman / sample-member-directory-duplicate.html
Created March 29, 2021 20:43
Example of duplicating the directory shortcode and wrap it within the Membership shortcode to show a unique member directory by level.
/* Example of duplicating the directory shortcode and wrap it within the Membership shortcode to show a unique member directory by level.
[membership level="1"]
[pmpro_member_directory levels="1"]
[/membership]
[membership level="2"]
[pmpro_member_directory levels="2"]
[/membership]
@kimcoleman
kimcoleman / pmpro_advanced_levels_compare_example.html
Last active January 29, 2023 16:57
Example of the Advanced Levels Shortcode with Comparison Items and Hyperlinks
/* Example of the Advanced Levels Shortcode with Comparison Items and Hyperlinks */
[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 / memberlite_center_primary_menu.css
Created March 23, 2021 14:15
Custom CSS to center the Primary menu in Memberlite
/* Custom CSS to center the Primary menu in Memberlite */
.main-navigation {
text-align: center;
}
.main-navigation li {
float: none;
display: inline-block;
}
@kimcoleman
kimcoleman / my_pmpro_change_level_edd_update_payment_status.php
Last active March 13, 2021 19:20 — forked from andrewlimaza/change-level-edd.php
Change user's membership level when a product is purchased in Easy Digital Downloads.
<?php
/**
* This recipe will allow you to assign a membership level to members when purchasing an EDD product.
* You can do this one of two ways:
*
* OPTION 1: Product ID and Membership Level
* $product_levels = array(
27 => 1, //27 is the EDD product ID. 1 is the membership level they get when purchasing product 27
);
*
@kimcoleman
kimcoleman / my_ffl_display_name_order.php
Last active March 12, 2021 19:17
Change the display name to default to LAST FIRST using the Force First Last WordPress plugin.
<?php
/*
* Change the display name to default to LAST FIRST using the Force First Last WordPress plugin.
* https://wordpress.org/plugins/force-first-last/
*
* 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.
*/
function my_ffl_display_name_order( $display_name_order, $first_name, $last_name ) {
$display_name_order = array( $last_name, $first_name );
@kimcoleman
kimcoleman / show_parent_expiration_date_for_child.php
Last active March 9, 2021 20:38
Show the parent account's expiration for the child.
<?php
/*
* Show the parent account's expiration for the child in various places on frontend and admin pages 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/
*/
function replace_parent_expiration_for_child( $user_id ) {
@kimcoleman
kimcoleman / show_gravatar_pmpro_account_bullets_top.php
Created February 11, 2021 01:19 — forked from strangerstudios/my_pmpro_account_bullets_avatars.php
Display a member's gravatar and a link to update at Gravatar on the Membership Account page "Profile" section.
<?php
/*
* Show a link to Gravatar and an avatar preview on the Profile section of the Membership Account page.
*
* 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 show_gravatar_pmpro_account_bullets_top() {
@kimcoleman
kimcoleman / custom_suffix_pmpro_affiliates_new_code.php
Created January 19, 2021 18:20
Filter to adjust the generated code for the Affiliates Add On.
<?php
/**
* Filter to adjust the generated code for the Affiliates 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/
*
*/