Forked from dwanjuki/my_show_userid_on_membership_card.php
Created
October 21, 2024 18:04
-
-
Save kimwhite/8237509a51e6506103dd0e051108978e 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