Changing Location of user Login Page in WordPress - wordpress

I have a login form setup for my WordPress site, but when a user types in the wrong user/pass it directs them to the WP login screen. Is there any way that I can change this without hacking WPMU core?

You will have to use below filter to change the login url.
add_filter('login_url','wdm_login_url',10,2);
function wdm_login_url($login_url, $redirect)
{
$login_url = home_url().'/your-page-slug/';
return $login_url;
}
So every time, request goes to wp login screen, it will get redirected to your page

You should use a plugin. A search for "login" on WP Plugins can be helpful, maybe check out this plugin.

you can make the login form (wp-login.php), redirect them back by providing a hidden input text name 'redirect_to' in form that you have written. by using 'redirect_to', Wordpress understand that you want after login user will send to the link
forexample :
[pre]http://xxx.xxx/wp-login.php?redirect_to='http://xxx.xxx' [pre]

Related

How to redirect users after form submission from mysite.com/services/ to mysite.com/services/thank-you-page

I need some help from you.
I am using Contact From 7 for my forms.
I need to redirect the users after successfully form submit from:
example.com/services/ to example.com/services/thank-you-page
The form is located here: example.com/services/. After a user hit the SEND form, instead of being redirected to the page example.com/thank-you-page/ I need the user to be redirected to a URL like so: example.com/services/thank-you-page
The Thank You Page is created.
How do I accomplish this?

Requiring Sign-In For Shortcode-Based Plugin

Developing a plugin for personal use that adds data-driven content to WordPress pages through shortcodes. In the current implementation, the shortcode php checks if the visitor is authorized (specifically, if the visitor is me), displays the data-driven content if authorized, and displays a message if not.
Instead of a message, I'd like to do an auth_redirect. But by the time my shortcode is parsed, WordPress has already begun sending content to the client, so the redirect doesn't happen.
Is there a (simple) way to get auth_redirect behavior from shortcodes? For instance, can I somehow pass the return URL to the wp-login page? Or do the authorization check earlier in the page processing?
It's much simpler than I thought: I can simply href to the login page and pass the current page's url as parameter:
esc_url(wp_login_url( get_permalink()))
Hyperlinking to this sends me to the wp login page, and the get_permalink parameter ensures I return to the calling page after login.

How to add forgot password link in WP-Members plugin?

I use the WP-Members plugin to register users on a WordPress site but I have no idea how to add a forgot password link in login form?
You can add the forgot password using the shortcode:
password
[wpmem_form password]
The password parameter will generate a password reset form for users who are not logged in and a change password form for logged in users. It can be used in conjunction with the logged-in and/or logged-out status shortcodes as well.
NOTE: These functions are also a component of the [wpmem_profile] shortcode, so if you have a user profile page already established, you do not need this page as well. This shortcode is for site admins that might desire a more granular level of control over how these elements are used.
Did you tried
Lost Password
The plugin adds a lost password link automatically when the location of the User Profile page is set in the plugin's main options.
As said by bulterblog when u create a new page and add [wpmem_profile] shortcode it will automatically add the forgot password link to the pages/post which you have blocked.

Accessing BigCommerce Logged In user from wordpress on subdomain

So I need a way to lock down both bigcommerce and wordpress if a user is not logged in. First suggestion was asking if when a user is created in bigcommerce create the same user account in WP... but that doesn't seem like a good approach to me since the user will not need any interaction as a user on WP just need to block access to pages if they are not logged in.
So my thought is to check if a user is logged into bigcommerce, then pass a variable to wp header file. If the variable does not exist then redirect them back to bigcommerce login. For this install BigCommerce is currently using the header from wp so they match and all works well so that is why I assume I should be able to pass a variable to check if a user is logged into bigcommerce or not. I have not been able to find any documentation in the API about accessing if a user is logged in or not.
Has anyone done anything like this and or know if this would be possible? Or know of a better solution for what I am trying to do. Maybe check for a cookie or session?
Recently I did a project where the client wanted to show custom content to bigcommerce loggedin users and block the rest. The best way I found was to check the value of %%GLOBAL_CurrentCustomerFirstName%%. It is "Guest" for non-loggedin users.
you can try this:
localStorage.setItem("user", %%GLOBAL_CurrentCustomerFirstName%% );
and then you can use on wordpress pages :
var user = localStorage.getItem("user");
if(user=="Guest"){
//redirect to login or block page
}
Obviously they can get around javascript so using ajax to store it somewhere and then retrieving it would be more secure but I hope this will help you proceed :)

How to redirect an user to the same page in which he browsed after login drupal

i am working on a website with drupal which has a lot of user restriction pages. when a user is guest and he need to access a webpage he will be asked for user name and password while he logged in he is redirected to the main page or account page .can i make the user to redirect to he same page not to the front page or account page,
If you are rendering a login link in your template file, you can do something like this:
print l("Login","user/login",array('query' => drupal_get_destination()));
If you would like a 'code-less' approach, then please checkout the Rules module.
Once enabled navigate to /admin/rules/trigger/add and create a 'triggered rule', for example:
Label: Redirect User Back to Original Page After Logging In
Event: User -> User Has Logged In
Then click 'Save Changes'... then click 'Add an action'...
Select an action to add: System -> Page Redirect
Here you can set 'php evaluation' to:
echo implode("/",arg());
That will redirect user back to the page they were on before they logged in.
Be careful not to redirect a user to the following paths:
user/login
user/register
logout
You can redirect the user by using the action and trigger
first go to site configuration and then select action where you can define your action.
For ex if you want to redirect the user after login : select redirect to url and hit the create button.
Then go to site building and click on trigger (if have installed it, this module comes up with drupal). Where you will find tabs like cron , user. According to your need select tab and apply your action and assign it.

Resources