network_settings_add_js() WordPress Function
This function will add the necessary JavaScript to the network settings page in order to properly save settings.
network_settings_add_js() #
Print JavaScript in the header on the Network Settings screen.
Source
File: wp-admin/includes/ms.php
function network_settings_add_js() {
?>
<script type="text/javascript">
jQuery( function($) {
var languageSelect = $( '#WPLANG' );
$( 'form' ).on( 'submit', function() {
// Don't show a spinner for English and installed languages,
// as there is nothing to download.
if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {
$( '#submit', this ).after( '<span class="spinner language-install-spinner is-active" />' );
}
});
} );
</script>
<?php
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 4.1.0 | Introduced. |