Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snippet-add user id to members account page #233

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions frontend-pages/add-user-id-to-members-account-page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/**
* Show the WordPress User ID as a Member ID on the Paid Memberships Pro Account Page
*
* title: Show the WordPress User ID
* layout: snippet
* collection: frontend-pages
* category: members-account-page
* url: https://www.paidmembershipspro.com/show-member-id-on-the-membership-account-page-for-paid-memberships-pro/
*
* 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/
*/


/**
* This shows the WordPress User ID as a Member ID on the Paid Memberships Pro Account Page.
* nothing to change.
*/

function pmpro_add_user_id_account() {
global $current_user;

echo '<li><strong>Member ID: </strong>' . $current_user->ID . '</li>';
}
add_action( 'pmpro_account_bullets_top', 'pmpro_add_user_id_account' );