Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login / Register #60

Closed
ravitelecom opened this issue Aug 20, 2018 · 15 comments
Closed

Login / Register #60

ravitelecom opened this issue Aug 20, 2018 · 15 comments
Labels

Comments

@ravitelecom
Copy link

Hi There

In the submit ticket page, if i click the login, it is taking me to WP login from, is it possible to use, my site registration form or if what if user signed in already?

Thanks

@mayeenulislam
Copy link
Member

mayeenulislam commented Aug 20, 2018

Pardon me. I'm not completely clear about your query. What I understood is:

  1. You want to redirect users to login through your custom login page
  2. What happens when the user is already logged in

Issue 1: Redirect user to Custom Login/Registration page

I don't know how your custom registration and login page is built. If it's built correctly, you should redirect users from the default WP login and registration form using respectively the login_url and the register_url filter hooks. If it's already done, by clicking the login and registration link it will redirect user to your custom made login and registration page.

Additionally, have you tried the 🅱️ beta feature: Embedded Login? You can enable NanoSupport's embedded login feature from the plugin's Settings page.

embedded-login

Issue 2: Ticket submission for Logged-in Users

When the user is logged in, the ticket submission form won't ask for login/registration; it will simply add ticket on behalf of the logged in user.

logged-in-user-submitting-ticket

Hope, it answers your queries.

@ravitelecom
Copy link
Author

ravitelecom commented Aug 20, 2018 via email

@mauamolat
Copy link

How do we use this filter hooks?

@mayeenulislam
Copy link
Member

@mauwiks the WordPress Developer Resources has user contributed notes below each of the content page. Otherwise you can google for it. It's by WordPress Core. There are plenty of resources available everywhere.

@mauamolat
Copy link

Thanks. But I would really appreciate if you could give a specific keyword of the idea if possible or any link covering this concern. I'm not a developer

@mauamolat
Copy link

Could we at least remove or edit the message with the login URL stated on the email template of nanosupport notification email when somebody have registered?

I only need to edit the URL and use my other custom login/register page (mysite.com/login) instead of the original one (mysite.com/wp-admin). The original login for WordPress is still available but it seems better for me that users use the other custom one.

@mayeenulislam
Copy link
Member

@mauwiks Putting more that one login page for the same purpose could be bad. Use login_url filter to redirect the current login page to the new one. You can get user-contributed note below the link on how you can implement this. And this will resolve the login link in email template issue too (inshALLAH).

@mauamolat
Copy link

Thanks!

@mauamolat
Copy link

mauamolat commented Sep 29, 2018

Hi @mayeenulislam,

In what I understood about the source and the user-contributed note:

To replace the default URL of the WordPress,

  1. I must copy the code from the source to my directory: wp-includes/general-template.php and;
  2. replace the /custom-login/ with the slug of my new or custom page for login/reg

Correct me if I'm wrong.

Another thing, should I copy this too? If not, what should I input in my case?

Thank you for your feedback.

@mayeenulislam
Copy link
Member

@mauwiks When you are not a developer, please hire a professional to do the thing. This is not the way to implement a filter hook. The code is to place in your theme's functions.php:

add_filter( 'login_url', 'issue_sixty_custom_login_url', 10, 3 );
function issue_sixty_custom_login_url( $login_url, $redirect, $force_reauth ){
    $login_url = site_url( '/custom-login/', 'login' );
    if ( ! empty( $redirect ) ) {
        $login_url = add_query_arg( 'redirect_to', urlencode( $redirect ), $login_url );
    }
    if ( $force_reauth ) {
        $login_url = add_query_arg( 'reauth', '1', $login_url );
    }
    return $login_url;
}

WARNING: PLEASE DON'T DO THINGS UNKNOWINGLY. IT COULD BE HARMFUL. NEVER EVER EDIT CORE CODE (either WordPress or any theme or plugin). FOR A THIRD PARTY THEME USE A CHILD THEME.

@mauamolat
Copy link

Oh, sorry @mayeenulislam

I'm new to the business and all of these stuff, the reason why I don't know any developer yet that I could trust or knows what I want to get done and even if someone could possibly do it, I don't know if I could afford to hire a professional developer. I've search a lot in google or forums but nothing could answer me in exact if they can get the job done. I'm really sorry to bother you for this. And thanks for the tip! :)

@mauamolat
Copy link

mauamolat commented Oct 1, 2018

Lastly,

Am I wrong to replace the /custom-login/ (alone)? The number 2 above. I'm using the theme "Themedd" of Easy Digital Downloads by the way

@mayeenulislam
Copy link
Member

@mauwiks yes you are right about point #2.

And another note, with hash (#) followed by a number (with no space in between, like #2) you are actually spoiling the Github issues with unwanted/unrelated references. You can see Issue #2 that, you created a reference to this issue without knowing (I understand you din't do it deliberately 😃). It should be avoided. If you want to write #2, use backticks (`) to embrace the text (screenshot: http://prntscr.com/l0pe3r).

@mauamolat
Copy link

Sorry again for that. Noted! What a shame for me

@mauamolat
Copy link

Thank you very much for the great insight everytime, and everything. More power to your team and family

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants