bp_registration_options_js

Add JS to our admin_footer output for DOM manipulation purposes.

Description

bp_registration_options_js(); 

Usage

  1. if ( !function_exists( 'bp_registration_options_js' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bp-registration-options/includes/admin.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_registration_options_js(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/admin.php  
  1. function bp_registration_options_js() { 
  2. ?> 
  3. <script language="javascript"> 
  4. (function($) { 
  5. //Handle our checkboxes 
  6. var checkboxes = $('.bpro_checkbox'); 
  7. $('#bp_checkall_top, #bp_checkall_bottom').on('click', function() { 
  8. if ( $(this).attr('checked')) { 
  9. $(checkboxes).each(function() { 
  10. if ( $(this).prop('checked', false) ) { 
  11. $(this).prop('checked', true); 
  12. }); 
  13. } else { 
  14. $(checkboxes).each(function() { 
  15. $(this).prop('checked', false); 
  16. }); 
  17. }); 
  18. //Confirm/cancel on deny/ban. 
  19. $('#bpro_deny').on('click', function() { 
  20. return confirm("<?php esc_html_e( 'Are you sure you want to deny and delete the checked member(s)?', 'bp-registration-options' ); ?>"); 
  21. }); 
  22. $('#bpro_ban').on('click', function() { 
  23. return confirm("<?php esc_html_e( 'Are you sure you want to ban and delete the checked member(s)?', 'bp-registration-options' ); ?>"); 
  24. }); 
  25. $('#reset_messages').on('click', function() { 
  26. return confirm("<?php esc_html_e( 'Are you sure you want to reset to the default messages?', 'bp-registration-options' ); ?>"); 
  27. }); 
  28. })(jQuery); 
  29. </script> 
  30. <?php