options_reading_add_js()

最后更新于:2021-11-27 18:10:25

options_reading_add_js()

Display JavaScript on the page.

源文件

文件: gc-admin/includes/options.php

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' ).on( 'change', check_disabled );
	});
</script>
	<?php
}