options_reading_add_js()
Display JavaScript on the page.
Хуков нет.
Возвращает
null. Ничего (null).
Использование
options_reading_add_js();
Список изменений
| С версии 3.5.0 | Введена. |
Код options_reading_add_js() options reading add js WP 7.1.3
<?php
function options_reading_add_js() {
?>
<script>
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
}