开发者

Redirection of Wordpress Registration

开发者 https://www.devze.com 2023-01-09 14:56 出处:网络
I am writing a wordpress module that will need to re-direct the registration process to a checkout. I have the checkout working, and I have added the extra options I need to the normal Wordpress regis

I am writing a wordpress module that will need to re-direct the registration process to a checkout. I have the checkout working, and I have added the extra options I need to the normal Wordpress registration screen.

I need some pointers on how to intercept the registration process before anything is committed to the database. After the checkout p开发者_开发知识库hase I need to then re-start the proccess and finish it.


Check out wp-login.php - that contains pretty much all the login and registration functions.

You'll see on line 300 (as of 3.0), you can hook onto the action register_post, which is called just before WP attempts to save the new user to the DB;

function my_register_post($sanitized_user_login, $user_email, $errors)
{
    // do your stuff!
}
add_action('register_post', 'my_register_post', 10, 3);
0

精彩评论

暂无评论...
验证码 换一张
取 消