I have gone ahead and released a bug fix for the bug discussed here. Now, the bug really effects only those that use moderated registration.
However, even if you do not use that feature, you may want to upgrade as I have also included some new action hooks. These hooks are in the registration function, which is also used for updating user data. (This is specifically the front-end WP-Members process, not the back-end user profile.)
The hooks all pass the field data in case you want to use it somewhere else – for example keeping external profiles up-to-date. There is Pre (before the data is recorded) and Post (after the data is recorded) for both new registration and user data update. In all of these cases, the data has already passed through validation.
The action hooks are:
- wpmem_pre_register_data
- wpmem_post_register_data
- wpmem_pre_update_data
- wpmem_post_update_data
For all of these, the fields and the data are passed in an array. The array values will vary depending upon the fields that you are using in your individual setup.
Here is an example that will print the array values and exit so you can get an idea of what is being passed:
add_action( 'wpmem_pre_register_data', 'my_pre_reg_hook', 1 ); function my_pre_reg_hook( $args ) { echo "<pre>"; print_r( $args ); echo "</pre>"; exit(); }
Enjoyed this article?
Don't miss a single post. Subscribe to our RSS feed!