Many times, researching the core files is more productive than any Google or Manual. Dropping the whole plugin directory in a code editor and researching for the string frm_after_create_entry
takes us to the create()
method where this hook happens.
After that, there's the update()
method and it provides the action hook: frm_after_update_entry
.
This hook passes two parameters: $id
and $new_values['form_id']
. I cannot reproduce your setup, so testing the hook is up to you.
Reference: Actions and filters are NOT the same thing…
In this example:
add_action( 'frm_after_update_entry', 'change_role_to_staff', 10, 2);
function change_role_to_staff( $form_id, $values ){
var_dump($values);
die();
}
- As this is an action hook, nothing has to be returned.
- There's no
$roles
or$atts
, the parameters are the form ID and Values. - What you're looking for is inside
$values
. var_dump()
anddie()
are for debugging purposes and must be removed at once after testing.- Do your
wp_update_user
with this values and adapting your previous code.