Support

Account

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.