WordPress.org

Ready to get started?Download WordPress

Forums

Give Users Trial Period (4 posts)

  1. Howdy_McGee
    Member
    Posted 2 years ago #

    So what I'm trying to do is give newly registered user a period of time they can access certain pages. After that period is up they lose access to those pages but if the admin wants to they can give extended access to certain users.

    So far what I have going is a custom role called "Trial Member" and only trail members have access to certain pages. What I need to do is after a certain amount of time they get downgraded to a subscriber. So the expiration time needs to be static (constant). This if the admin wants they can go back in and upgrade the user to trail member which will start the time the user has access the the pages over again.

    If this makes sense. Suggestions on what I can do?

  2. h0tw1r3
    Member
    Posted 2 years ago #

    > Suggestions on what I can do?

    Start searching :)

    Role Scoper sounds like the plugin for you.

  3. Howdy_McGee
    Member
    Posted 2 years ago #

    This seems like a good start to what I need but it uses static/constant dates to decide how long a user has a certain role/group. So I need to edit it somehow / find something new that has dynamic time.

  4. Howdy_McGee
    Member
    Posted 2 years ago #

    Oh Kay So I added these two plugins and got the result I needed (really all you need is the Members Plugin). Oddly enough their names are very similar:

    The Members Plugin allows me to create member roles and member groups (like TrialMember).

    Then I used The Membership Plugin (Lite) to add my Levels and Subscription. Then you add your Level to your Subscription which will give you the option to set a time limit on how long the user will have this subscription. You can also set default registration to fall into this subscription which will also give you access.

    And finally I use this code to keep people from the admin panel (my person preference):

    function prevent_admin_access() {
        if (strpos(strtolower($_SERVER['REQUEST_URI']), '/wp-admin') !== false && !current_user_can('level_10')) {
            wp_redirect(get_option('siteurl'));
        }
    }
    add_action('init', 'prevent_admin_access', 0);

    Hope it helps somebody down the road!

Topic Closed

This topic has been closed to new replies.

About this Topic