Forked from strangerstudios/my_pmpro_member_links
Last active
April 10, 2023 12:51
-
-
Save kimcoleman/b59a167a6d2997f19b32b5f6cce2b69a to your computer and use it in GitHub Desktop.
Example of how to add links to the Member Links list on the Membership Account page.
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 | |
/** | |
* Example of how to add links to the Member Links list on the Membership Account page. | |
* | |
*/ | |
// Add links to the top of the list | |
function my_pmpro_member_links_top() { | |
//Add the level IDs here | |
if ( pmpro_hasMembershipLevel( array(1,2,3 ) ) ) { | |
//Add the links in <li> format here ?> | |
<li><a href="/top/">My Member Link Top</a></li> | |
<?php | |
} | |
} | |
add_filter( 'pmpro_member_links_top','my_pmpro_member_links_top' ); | |
// Add links to the bottom of the list | |
function my_pmpro_member_links_bottom() { | |
//Add the level IDs here | |
if ( pmpro_hasMembershipLevel( array( 1,2,3 ) ) ) { | |
//Add the links in <li> format here ?> | |
<li><a href="/bottom/">My Member Link Bottom</a></li> | |
<?php | |
} | |
} | |
add_filter( 'pmpro_member_links_bottom','my_pmpro_member_links_bottom' ); |
An updated version of this code is available here: https://github.com/strangerstudios/pmpro-snippets-library/blob/dev/frontend-pages/add-members-links-to-members-account-page.php
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This recipe is included in the blog post on "Add Links by Membership Level to the Membership Account Page “links” Section" at Paid Memberships Pro here: https://www.paidmembershipspro.com/add-links-membership-level-membership-account-page-links-section/