options_permalink_add_js

The timeline below displays how wordpress function options_permalink_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
 * @deprecated 4.9.0
 */
function options_permalink_add_js()
{
    ?>
	<script type="text/javascript">
		jQuery( function() {
			jQuery('.permalink-structure input:radio').change(function() {
				if ( 'custom' == this.value )
					return;
				jQuery('#permalink_structure').val( this.value );
			});
			jQuery( '#permalink_structure' ).on( 'click input', function() {
				jQuery( '#custom_selection' ).prop( 'checked', true );
			});
		} );
	</script>
	<?php 
}

WordPress Version: 4.9

/**
 * Display JavaScript on the page.
 *
 * @since 3.5.0
 * @deprecated 4.9.0
 */
function options_permalink_add_js()
{
    ?>
	<script type="text/javascript">
		jQuery(document).ready(function() {
			jQuery('.permalink-structure input:radio').change(function() {
				if ( 'custom' == this.value )
					return;
				jQuery('#permalink_structure').val( this.value );
			});
			jQuery( '#permalink_structure' ).on( 'click input', function() {
				jQuery( '#custom_selection' ).prop( 'checked', true );
			});
		});
	</script>
	<?php 
}

WordPress Version: 8.1

/**
 * Display JavaScript on the page.
 *
 * @since 3.5.0
 */
function options_permalink_add_js()
{
    ?>
<script type="text/javascript">
jQuery(document).ready(function() {
	jQuery('.permalink-structure input:radio').change(function() {
		if ( 'custom' == this.value )
			return;
		jQuery('#permalink_structure').val( this.value );
	});
	jQuery( '#permalink_structure' ).on( 'click input', function() {
		jQuery( '#custom_selection' ).prop( 'checked', true );
	});
});
</script>
<?php 
}

WordPress Version: 4.2

/**
 * Display JavaScript on the page.
 *
 * @since 3.5.0
 */
function options_permalink_add_js()
{
    ?>
<script type="text/javascript">
jQuery(document).ready(function() {
	jQuery('.permalink-structure input:radio').change(function() {
		if ( 'custom' == this.value )
			return;
		jQuery('#permalink_structure').val( this.value );
	});
	jQuery('#permalink_structure').focus(function() {
		jQuery("#custom_selection").attr('checked', 'checked');
	});
});
</script>
<?php 
}

WordPress Version: 3.7

/**
 * Display JavaScript on the page.
 *
 * @since 3.5.0
 */
function options_permalink_add_js()
{
    ?>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function() {
	jQuery('.permalink-structure input:radio').change(function() {
		if ( 'custom' == this.value )
			return;
		jQuery('#permalink_structure').val( this.value );
	});
	jQuery('#permalink_structure').focus(function() {
		jQuery("#custom_selection").attr('checked', 'checked');
	});
});
//]]>
</script>
<?php 
}