How to get membership level id f a particular user [closed]

You probably want pmpro_getMembershipLevelsForUser from functions.php: /* pmpro_getMembershipLevelsForUser() returns the membership levels for a user * * If $user_id is omitted, the value will be retrieved from $current_user. * By default it only includes active memberships. * * Return values: * Success returns an array of level objects. * Failure returns false. */ function pmpro_getMembershipLevelsForUser($user_id … Read more

Premium Members Section of website

The best way to have complete control is to use conditionals in your templates. Look at current_user_can() for specific permissions – or if its simply for being logged in you could use is_user_logged_in(). eg: if( is_user_logged_in() ){ // echo product details }else{ //echo login form and message } That we you have complete control over … Read more

New User Sessions in WordPress?

Instead of forcing WordPress to have a custom membership system, if you want to use your own small membership feature, then you may not have to use sessions at all. For instance, if you want to password protect a specific set of pages, you could make one page require authentication, using a username and password … Read more

Memberpress isn’t cooperating with WooCommerce

Just solved this. Under memberpress options, we had to uncheck the option to “Keep members out of the WordPress Dashboard”. That was it! I think the woocommerce checkout page was using ajax to call “admin-ajax.php”. Memberpress was preventing users from accessing this page so it brought up the login redirect page instead. We’ll keep users … Read more

How to give members access to their own protected page?

funtion add_profile_page(){ $title_of_page = “page name”; if( null == get_page_by_title( $title_of_page ) ) { $post_id = wp_insert_post( array( ‘comment_status’ => ‘closed’, ‘ping_status’ => ‘closed’, ‘post_author’ => ‘1’, ‘post_name’ => ‘namehere’, ‘post_title’ => $title_of_page, ‘post_status’ => ‘publish’, ‘post_type’ => ‘page’ ) ); update_post_meta($post_id, ‘_wp_page_template’, ‘mycustomprofile’); } } add_filter( ‘after_setup_theme’, ‘add_profile_page’ ); your template page /* Template … Read more