• Hi Andrew,
    I am here again πŸ™‚

    function pmproc_hide_free_levels($levels){
        if( is_user_logged_in() && pmpro_hasMembershipLevel() ){ //check if user is logged in and has a membership level
        $newlevels = array();
          foreach($levels as $level){
              if(!pmpro_isLevelFree($level)){
                $newlevels[] = $level;
              }
          }   
          return $newlevels;
        }
        return $levels;
    }
    add_filter("pmpro_levels_array", "pmproc_hide_free_levels");

    Only admin can see this free membership in front side. how this is possible with above function. any idea what i need to change in above function please.I have tried some condition but not working so.

    Thanks
    Ahir

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter LogicRays Technologies

    (@logicrays)

    Hi

    Sorry Andrew,

    again i solved it.

    Thanks

    Plugin Author Andrew Lima

    (@andrewza)

    It’s no problem at all Ahir.

    I would personally use current_user_can( 'manage_options' ) within the conditional check.

    Glad to hear you have solved it! πŸ™‚

    Please feel free to reach out if you have any further questions.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Free leval only for Admin’ is closed to new replies.