network_settings_add_js

Print JavaScript in the header on the Network Settings screen.

Description

network_settings_add_js(); 

Usage

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

Defined (1)

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

/wp-admin/includes/ms.php  
  1. function network_settings_add_js() { 
  2. ?> 
  3. <script type="text/javascript"> 
  4. jQuery(document).ready( function($) { 
  5. var languageSelect = $( '#WPLANG' ); 
  6. $( 'form' ).submit( function() { 
  7. // Don't show a spinner for English and installed languages,  
  8. // as there is nothing to download. 
  9. if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) { 
  10. $( '#submit', this ).after( '<span class="spinner language-install-spinner" />' ); 
  11. }); 
  12. }); 
  13. </script> 
  14. <?php