I have a custom plugin that I would like to fire ~after~ a user has registered with the pie register screen, but before verification. The custom plugin code is using the ‘user_register’ action hook at which time I query the user metadata for the register_type. Using WP_DEBUG_LOG and error_log, I can see that inside my function, the register_type metadata is not there yet. So apparently hooking into user_register is too early. Can you please recommend an appropriate action to hook into once the registration is complete but before the user verifies?

My second issue is that if I want my plugin to work for everyone, I need to be able to hook into a common action that is available regardless of whether your plugin is installed or not, so when I originally asked for another action hook, I wasn’t expecting you to suggest a proprietary one. I was hoping you had a do_action somewhere that calls the standard WP actions to complete the process, such as the user_register action. Lastly, I still have a separate hook for the user_register action, and that does fire AFTER your proprietary action, and with the same get_user_meta command, the register_type value is still not in the database. If it’s available in pie_register_after_register_validate and that fires before user_register, then I shouldn’t need pie_register_after_register_validate, and should just need user_register, but the data’s just not there. Or am I using get_user_meta incorrectly? I’m sorry, this is my first try at developing this plugin, but I thought for sure that is the proper way to use get_user_meta.

Thanks for your more details, well, the user_register is the first hook that available after the user registers so on that hook the register_type meta wont be available, to have the register_meta available I would recommend you to use pie_register_after_register hook.

Thank you Hasnain. That action hook does work to get the register_type. Can I make a request that your next version move up the logic that creates this meta data to be ~before~ the user_register action since all meta data should already be available by that time and allows other developers to be more generic?

I am glad you got it working. Well, since PR uses wp registration functions to register a user so its not possible to have user meta available on or before user_register hook, however, perhaps we will try our best to have other global hook available on the registration.

I’m also working on a plugin that will create a draft post when a user registers. Tried using pie_register_after_register as suggested in this thread, but it’s still not wanting to work.

I’ve narrowed it down to having the Paypal active and installed on the reg form. Draft post is created as expected without the Paypal gateway active. As soon as I activate and register another test user…no draft post.

I started my own topic on this, but haven’t had any bites yet. Any help is appreciated! My code is as follows: