Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Replace Vanilla login context with Wordpress login context
I followed Mark's instructions for integrating Wordpress and Vanilla, and now I'd like to do something I think should be pretty simple but that I'm really not sure how to begin. I've read through the docs about the PostBack class, and I guess that this could be done by writing a new Control element, but I think it might actually be simpler than that:
Essentially, what I'd like to do is to stop using the Vanilla login and signup method. I want to do this because when you create an account through Vanilla, it doesn't update wp_usermeta the way that Wordpress does, and I'd like to be able to have users handle everything on their own without my having to modify the user account manually. (If you create an account through Vanilla, it doesn't set a user role on the Wordpress side, which means that users can't modify their own profiles until a role is set.)
I'm not quite sure where I need to start with this. I could go one of two routes with it:
Anybody know where I might start? Maybe somebody that's done something similar? Thanks!
Essentially, what I'd like to do is to stop using the Vanilla login and signup method. I want to do this because when you create an account through Vanilla, it doesn't update wp_usermeta the way that Wordpress does, and I'd like to be able to have users handle everything on their own without my having to modify the user account manually. (If you create an account through Vanilla, it doesn't set a user role on the Wordpress side, which means that users can't modify their own profiles until a role is set.)
I'm not quite sure where I need to start with this. I could go one of two routes with it:
- I could rewrite the actual login form in people_signin_form_nopostback.php and change the form itself so that it points to the WP login form action.
- I could change the links themselves to point to /wp-login.php, /wp-login.php?action=register, wp-login.php?action=logout, etc.
- With the first, I can keep the Vanilla theming but have one backend. This means less styling but more PHP work, which I'm more wary of doing, mainly because I'm more familiar with Wordpress's structure and almost completely unfamiliar with Vanilla's.
- With the latter option, I would lose the Vanilla login and signup pages, but that may be for the best, given that the Wordpress account signup process is the easier to follow (enter a username, enter an email address—it emails you a password and you go set up your profile).
Anybody know where I might start? Maybe somebody that's done something similar? Thanks!
0
This discussion has been closed.
Comments
To redirect upon login, you'll want something similar to the following:
wordpress: themes/[your custom theme name]/sidebar.php
<a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo get_option('siteurl').$_SERVER['REQUEST_URI'] ?>">login</a>
vanilla: themes/[your custom theme name]/menu.php
echo $this->Context->GetDefinition('NotSignedIn').' (<a href="'.AppendUrlParameters($this->Context->Configuration['SIGNIN_URL'], 'redirect_to='.GetRequestUri()).'">'.$this->Context->GetDefinition('SignIn').'</a>)';