WordPress开发者和主题制作者的搜索引擎



options_reading_add_js ›

Since3.5.0
已弃用n/a
options_reading_add_js ( 没有参数 )
定义在:
文档:

Display JavaScript on the page.



源码

function options_reading_add_js() {
	?>
<script type="text/javascript">
	jQuery(document).ready(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' ).change( check_disabled );
	});
</script>
	<?php
}