• Resolved xabdu

    (@xabdu)


    Hi,

    I want to Restrict non-users from viewing the single meeting page, they must be logged in to view the meeting. How can I do that?

    Thank you

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor digamberpradhan

    (@digamberpradhan)

    Hi @xabdu ,

    You can do this either via custom code or using plugins to determine if users/visitors can visit a single meeting page.

    If you are comfortable coding and adding changes to your site – you can use the following code to redirect a user.

    function cm_20220810_redirect_if_single_zoom_page(){
        if(is_singular( 'zoom-meetings' )){
            wp_redirect( home_url() );
            die;
        }
    
    }
    
    add_action( 'template_redirect', 'cm_20220810_redirect_if_single_zoom_page' );
    Thread Starter xabdu

    (@xabdu)

    Hi, @digamberpradhan

    It seems you did not understand me.

    I want the nonusers, when they enter the single meeting page, it takes them to the login page (https://*****.net/login-zoom-meetings/), but the logged-in user can access the page normally.

    And if you could redirect them back to the (https://*****.net/zoom-meetings/) page after they log in, it would be great.

    • This reply was modified 2 years, 7 months ago by xabdu.
    • This reply was modified 2 years, 7 months ago by xabdu.
    Plugin Contributor digamberpradhan

    (@digamberpradhan)

    Hi @xabdu ,

    Can you please describe how the code is not working please ?
    One slight change – you need to check if user is not logged in.

    function cm_20220810_redirect_if_single_zoom_page(){
        if(!is_user_logged_in() && is_singular( 'zoom-meetings' )){
            wp_redirect( home_url() );
            die;
        }
    
    }
    
    add_action( 'template_redirect', 'cm_20220810_redirect_if_single_zoom_page' );
    
    Thread Starter xabdu

    (@xabdu)

    @digamberpradhan

    See the comment above I noticed that you did not understand what I wanted; I have edited the comment

    Thread Starter xabdu

    (@xabdu)

    @digamberpradhan

    Could you redirect them back to the (https://*****.net/zoom-meetings/) page after they log in?

    Thread Starter xabdu

    (@xabdu)

    It’s ok @digamberpradhan, I have edited the settings to make them redirect after they log in to the same page they came from.

    The code worked.

    Thank you.

    Plugin Contributor digamberpradhan

    (@digamberpradhan)

    @xabdu ,

    I’m glad you were able to figure it – out cheers.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Restrict non user to view single meeting page’ is closed to new replies.