options_reading_add_js

The timeline below displays how wordpress function options_reading_add_js has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.9

/**
 * Display JavaScript on the page.
 *
 * @since 3.5.0
 */
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 
}

WordPress Version: 5.7

/**
 * Display JavaScript on the page.
 *
 * @since 3.5.0
 */
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 
}

WordPress Version: 5.2

/**
 * Display JavaScript on the page.
 *
 * @since 3.5.0
 */
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 
}

WordPress Version: 5.1

/**
 * Display JavaScript on the page.
 *
 * @since 3.5.0
 */
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 
}

WordPress Version: 4.2

/**
 * Display JavaScript on the page.
 *
 * @since 3.5.0
 */
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 
}

WordPress Version: 3.7

/**
 * Display JavaScript on the page.
 *
 * @since 3.5.0
 */
function options_reading_add_js()
{
    ?>
<script type="text/javascript">
//<![CDATA[
	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 
}