This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ,'' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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'] |