Last active
October 22, 2024 06:36
-
-
Save dwanjuki/86a2aa784a0b824350a252e2202ee7a3 to your computer and use it in GitHub Desktop.
Show WordPress User ID on Membership Card
This file contains 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 | |
/** | |
* This recipe will add the member's WordPress User ID to your 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 my_show_userid_on_membership_card( $pmpro_membership_card_user ) { | |
echo '<p><strong>Member ID:</strong> ' . $pmpro_membership_card_user->ID . '</p>'; | |
} | |
add_action( 'pmpro_membership_card_after_card', 'my_show_userid_on_membership_card' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment