options_discussion_add_js

Output JavaScript to toggle display of additional settings if avatars are disabled.

Description

options_discussion_add_js(); 

Usage

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

Defined (1)

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

/wp-admin/includes/options.php  
  1. function options_discussion_add_js() { 
  2. ?> 
  3. <script> 
  4. (function($) { 
  5. var parent = $( '#show_avatars' ),  
  6. children = $( '.avatar-settings' ); 
  7. parent.change(function() { 
  8. children.toggleClass( 'hide-if-js', ! this.checked ); 
  9. }); 
  10. })(jQuery); 
  11. </script> 
  12. <?php