Skip to content

Instantly share code, notes, and snippets.

View kimcoleman's full-sized avatar

Kim Coleman kimcoleman

View GitHub Profile
@kimcoleman
kimcoleman / my_ffl_display_name_just_first.php
Created May 18, 2021 13:41
Change the display name to default to just the first name using the Force First Last WordPress plugin.
<?php
/*
* Change the display name to default to just the first name 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_just_first( $display_name_order, $first_name, $last_name ) {
$display_name_order = array( $first_name ,'' );
@kimcoleman
kimcoleman / dynamic_pmpro_levels_array.php
Created May 12, 2021 20:37 — forked from ipokkel/dynamic_pmpro_levels_array.php
Dynamically display certain levels on the Membership Levels page based on the current user's active level
<?php
/**
* Dynamically display certain levels on the Membership Levels page based on the current user's active level
* This example allows you to show/hide specific levels on the Membership Levels page.
*/
/**
* Dynamically display certain levels on the Membership Levels page based on the current user's active level
* This example allows you to show/hide specific levels on the Membership Levels page.
*/
function dynamic_pmpro_levels_array( $levels ) {
@kimcoleman
kimcoleman / hide-confirm-email-password.php
Last active October 19, 2022 18:25 — forked from strangerstudios/gist:4027538
Hide the confirm email and confirm password fields from the Paid Memberships Pro checkout page.
<?php
/*
* Don't show confirm password or email fields on the checkout 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/
*/
add_filter( 'pmpro_checkout_confirm_password', '__return_false' );
@kimcoleman
kimcoleman / my_template_redirect_member_profile_permissions.php
Last active April 16, 2021 19:03
Redirect member away from the Member Profile page if they do not have access to view this member's profile.
<?php
/*
* Redirect member away from the Member Profile page if they do not have access to view this member's profile.
*
*/
function my_template_redirect_member_profile_permissions() {
global $pmpro_pages;
if ( empty( $pmpro_pages ) || empty( $pmpro_pages['profile'] ) || ! is_page( $pmpro_pages['profile'] ) ){
return;
@kimcoleman
kimcoleman / custom_pmpro_membership_card_qr_code_size.php
Created April 9, 2021 11:08
Adjust the size of the QR code on Membership Card.
<?php
/*
* Adjust the size of the QR code on Membership Card.
*
* 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 custom_pmpro_membership_card_qr_code_size( $size ) {
@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;
}