• When a person is logged in, but not a paid user, I want it so that he shouldn’t be able to Add an Event. Is there a way to hide the “Add an Event” button? I’m using BuddyPress and Paid Membership Pro together on the site, but I thought that this issue may just be an Events Manager problem.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Let’s say you already assigned the existing members a role that has the edit_events and and edit_other_events capability. Let’s call that role “member”. You could then add a code snippet to assign the member role when someone becomes a member or removes the member role when they are no longer a member.

    add_action('pmpro_after_change_membership_level', 'my_change_membership_level', 10, 3);
    function my_change_membership_level($level_id, $user_id, $old_level)
    {
    $user = get_userdata($user_id);
    if (!$user)
    return;

    if (false !== $level_id && $level_id > 0) {
    $user->add_role('member');
    }
    else {
    $user->remove_role('member');
    }
    }

    You could use the Code Snippets plugin to add this code snippet.

    You can use the Members plugin to create roles and to assign roles to users.

    When they don’t have the edit_events capability, the “Add New” button will not appear.

    Thread Starter wildbluephlox

    (@wildbluephlox)

    Oh okay. Thank you!!

    TreeTrail

    (@aprilschmitt27)

    @wildbluephlox, you may have tried this already, but if not try these 2 steps:

    1. To require membership add this to a footer, sidebar, or page:

    [membership]

    Event Add or Edit


    [/membership]

    2. Then look thru: WP>Events>Settings>General>User Capabilities>Event Capabilities. Use that fantastic functionality to adjust per WP Role.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.