Problem:
Using cred form to remove user was triggering a fatal error and not deleting the user
Solution:
I added a priority and fixed param numbers to the add_action call. I also test if the form_data is valid before moving forward to the deletion:
function efm_delete_user( $user_id, $form_data ){ if ( isset($form_data) && !empty($form_data) && isset($form_data['id']) && $form_data['id'] == 5846 ) { require_once( ABSPATH.'wp-admin/includes/user.php' ); wp_delete_user( $user_id ); } } add_action( 'cred_submit_complete', 'efm_delete_user', 10, 2 );
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | - |
- | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | - |
Supporter timezone: America/Sao_Paulo (GMT-03:00)
This topic contains 4 replies, has 2 voices.
Last updated by 8 months, 2 weeks ago.
Assisted by: Mateus Getulio.