JS addition to deselect the 'check all' box
-
I found myself needing to hit the ‘select all’ check box on users in WP Admin and add/remove them from a group. The JS would then deselect the users’ checkboxes upon completion, but not the ‘check all’ boxes. So I updated the JS to do just that..
File: core-ajax.js (and/or core-ajax-dev.js)
Function: CTXPS_Ajax.addBulkUsersToGroup()
Change: add 2 lines to deselect the ‘check all’ options when deselecting all the other selected checkboxes …if(response.find(‘bulk_enroll’).attr(‘id’) == ‘1’){
checkedArray.removeAttr(‘checked’).prop(‘checked’,false);
jQuery(‘#cb-select-all-1’).removeAttr(‘checked’).prop(‘checked’,false);
jQuery(‘#cb-select-all-2’).removeAttr(‘checked’).prop(‘checked’,false);
}
- The topic ‘JS addition to deselect the 'check all' box’ is closed to new replies.