Community Forum

Forum Replies Created

  • Maurizio Coda
    Participant
    # 1 year, 3 months ago

    nope! do not work:

    This page does not redirect correctly

    this is the snippet:

    /**
     * Prevent subscriber to access the dashboard
     */
    function wpca_redirect_subscribers()
    {
    // Make sure WPCA is activated
    if(!function_exists(‘cuar_is_customer_area_page’)) return;
    // Make sure we’re browsing the private area
    if (!cuar_is_customer_area_page(get_queried_object()) && !cuar_is_customer_area_private_content(get_the_ID()))
    return;
    // If current page is a WPCA page or post and user is subscriber, redirect to a custom page
    if (current_user_can(‘subscriber’)) {
    exit();
    }
    }
    add_action(‘template_redirect’, ‘wpca_redirect_subscribers’);

     

    in reply to: Subscriber role
    Maurizio Coda
    Participant
    # 1 year, 3 months ago

    CIao THomas,
    to be clearer I need “Subscriver” users to be disregarded by the WP Customer Area for which I have created a dedicated user type with “User Role Editor”.
    The subscriber should not enter the private area at all

    Thank you

    Maurizio

    in reply to: Subscriber role
    Maurizio Coda
    Participant
    # 1 year, 3 months ago

    Hi Thomas,

    no, it’s not redirecting using above snippet

     

    in reply to: Subscriber role
    Maurizio Coda
    Participant
    # 1 year, 3 months ago

    I noticed that get_the_ID() is empty

    in reply to: Subscriber role
    Maurizio Coda
    Participant
    # 1 year, 3 months ago

    cieo and thanks for the snippet,
    something is still not working, after logging in the subscriber is always sent to the private area and not to the mil custom link.
    There is something telling the user to go to the private area.
    Can you help me?
    thanks Maurizio

    in reply to: Subscriber role
Viewing 5 posts - 1 through 5 (of 5 total)