options_reading_add_js() WordPress Function
The options_reading_add_js() function is used to add JavaScript to the reading options page in the WordPress admin. This function is used to add JavaScript to the reading options page in the WordPress admin.
options_reading_add_js() #
Display JavaScript on the page.
Source
File: wp-admin/includes/options.php
function options_reading_add_js() { ?> <script type="text/javascript"> jQuery( function($) { var section = $('#front-static-pages'), staticPage = section.find('input:radio[value="page"]'), selects = section.find('select'), check_disabled = function(){ selects.prop( 'disabled', ! staticPage.prop('checked') ); }; check_disabled(); section.find( 'input:radio' ).on( 'change', check_disabled ); } ); </script> <?php }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.5.0 | Introduced. |