Description
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 | Details |
---|---|---|
$button | String | The button html |
Examples
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 can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?