gravityflow_update_button_user_input
The gravityflow_update_button_user_input filter allows the Update button to be modified on the User Input step when the Save Progress option is set to either hidden or to radio button setting.
Parameters
Parameter | Type | Definition |
---|---|---|
$button | HTML | The HTML for the "Update" button |
Examples
Example 1 - Hide the Update button when the logged in user belongs to a particular role/user
add_filter( 'gravityflow_update_button_user_input', 'sh_gravityflow_update_button_user_input', 10, 1 ); function sh_gravityflow_update_button_user_input($update_button) { $user = wp_get_current_user(); $roles[] = $user->roles; if ( in_array( 'administrator', (array) $user->roles ) ) { return false; } else return $update_button; }
Placement
This code should be placed in the functions.php file of your active theme or in a custom functions plugin.