Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kimwhite/8237509a51e6506103dd0e051108978e to your computer and use it in GitHub Desktop.
Save kimwhite/8237509a51e6506103dd0e051108978e to your computer and use it in GitHub Desktop.
Show WordPress User ID on Membership Card
<?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