Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
Show or hide the 'Delete ALL Entries' button with custom conditions.
Usage
add_filter( 'frm_show_delete_all', 'frm_maybe_hide_button', 10, 2 );
Parameters
- $show (boolean) - Defaults to true if user has permission to edit entries.
- $form_id (int)
Examples
Hide delete button for everyone
add_filter( 'frm_show_delete_all', '__return_false' );
Show only for admins
Hide the button from everyone except those with administrator permissions.
add_filter( 'frm_show_delete_all', 'frm_maybe_hide_button' );
function frm_maybe_hide_button( $show ) {
$show = current_user_can('administrator');
return $show;
}