Community Forum

Forum Replies Created

  • Maurizio Coda
    Participant
    # il y a 8 mois

    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
    # il y a 8 mois et 1 semaine

    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
    # il y a 8 mois et 1 semaine

    Hi Thomas,

    no, it’s not redirecting using above snippet

     

    in reply to: Subscriber role
    Maurizio Coda
    Participant
    # il y a 8 mois et 1 semaine

    I noticed that get_the_ID() is empty

    in reply to: Subscriber role
    Maurizio Coda
    Participant
    # il y a 8 mois et 1 semaine

    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
5 sujets de 1 à 5 (sur un total de 5)