Skip to content

Instantly share code, notes, and snippets.

@NikV
Last active September 7, 2015 22:55
Show Gist options
  • Save NikV/9e96364311a6de8505ec to your computer and use it in GitHub Desktop.
Save NikV/9e96364311a6de8505ec to your computer and use it in GitHub Desktop.
Change the trash link when deleting a form, also changing the format of the input into a button. And few inline styles.
function modify_gfroms_trash_link() {
return '<button style="background: red; color: white; border: none;" class="submitdelete" title="' . __( 'Move this form to the trash', 'gravityforms' ) . '" onclick="if(confirm(\'' . __( "Would you like to move this form to the trash? \'Cancel\' to stop. \'OK\' to continue", 'gravityforms' ) . '\')){ gf_vars.isFormTrash = true; jQuery(\'#form_trash\')[0].submit();} else{return false;}">' . __( 'Trash', 'gravityforms' ) . '</button>';
}
add_filter('gform_form_trash_link', 'modify_gfroms_trash_link');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment