Paid Memberships Pro
Displaying divs based on membership level (1 post)

  1. deutschwulf
    Posted 3 years ago #


    I'm working on a site where people will be able to see profiles for members to my site. What I need to be able to do is display specific divs on these profile pages depending on that member's subscription level.

    I've used the below code in the past, but obviously it's based on role rather than membership level:

    $user = new WP_User( $post->post_author );
    						if ( !empty( $user->roles ) && is_array( $user->roles ) ) {
            					foreach ( $user->roles as $role )
                    				echo $role;}
    						if ( $role == 'editor' ){echo "You can see this because you're an editor";}

    I want to accomplish basically the same thing that this code does, but rather than by role, do it by membership.

    Any thoughts? Thanks!



Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Paid Memberships Pro
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic