Home › Forums › Front-end Issues › Memberpress support › Reply To: Memberpress support
If I understand this correctly, ACF can only be used by modifying the theme templates? If that’s the case, then I think using our PHP conditionals would be the only way to make this work (unless you added some kind of global output filter for all fields).
MemberPress has a number of PHP conditionals which can be used in templates.
This first conditional requires a Rule to be set in MemberPress for the current WP_Post (page, post, or custom post type).
<?php if(current_user_can('mepr_auth')) //A Rule exists in MP for the current $post {
// acf content output here
}
The second conditional does not require a Rule to be setup at all, and instead checks if the user has purchased any of the listed Membership levels (by their ID)
<?php if(current_user_can('mepr-active', 'memberships: 123, 321')) //123, 321 etc are ID's of Memberships {
// acf content output here
}
And if the user didn’t want to go through the effort of adding any PHP conditionals, then the redirect on unauthorized setting would be the final option.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.