Last active
July 8, 2021 17:35
-
-
Save strangerstudios/7372367 to your computer and use it in GitHub Desktop.
Use a filter to adjust the content of the user page that is created with PMPro and the User Pages addon.
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 | |
/* | |
When the user page is created, add some content. | |
*/ | |
function my_pmpro_user_page_purchase_postdata_content($postdata, $user, $level) | |
{ | |
//update post content | |
$postdata['post_content'] = "<p>Thank you for using our site.</p> | |
<p>This is some extra content for the user page.</p> | |
<p>We got links:</p> | |
<ul style='margin-bottom: 3em;'> | |
<li><a href='" . home_url() . "'>Homepage</a></li> | |
<li><a href='" . home_url("/members/") . "'>Members Area</a></li> | |
<li><a href='" . home_url("/contact/") . "'>Contact Us</a></li> | |
</ul>"; | |
return $postdata; | |
} | |
add_filter("pmpro_user_page_purchase_postdata", "my_pmpro_user_page_purchase_postdata_content", 10, 3); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have forked this to allow for multiple levels
https://gist.github.com/kimwhite/5e16208b33a725422203798c499c63b9