Created
January 26, 2018 12:47
-
-
Save andrewlimaza/6131ebf580ad3817b7357f49b5017d35 to your computer and use it in GitHub Desktop.
Add Link to BBPress on Account Page of Paid Memberships Pro
This file contains hidden or 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 | |
| /** | |
| * Adds a link to BBPress topics for current user on their Paid Memberships Pro Account Page. | |
| * Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| * www.paidmembershipspro.com | |
| */ | |
| function pmpro_add_link_to_account_page() { | |
| global $current_user; | |
| $username = $current_user->user_nicename; | |
| //generate the bbpress forum link | |
| $link = esc_url( "/forums/users/$username/topics/" ); //adjust path to all topics for a user. | |
| echo "<li><a href='$link'>View All Topics</a><li>"; | |
| } | |
| add_action( 'pmpro_account_bullets_top', 'pmpro_add_link_to_account_page' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment