# speechkit/4.0.1/src/Component/Settings/Preselect/settings.js

BeyondWords – AI audio for publishers, version 4.0.1. 36 lines.

- Page: https://pluginprobe.com/plugins/speechkit/4.0.1/code/src/Component/Settings/Preselect/settings.js
- Raw: https://pluginprobe.com/plugins/speechkit/4.0.1/raw/src/Component/Settings/Preselect/settings.js
- Modified: 2023-07-29T23:31:04+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/speechkit/4.0.1/code/src/Component/Settings/Preselect/settings.js#L10-L20`.

```javascript
/* global jQuery */

( function ( $ ) {
	'use strict';

	const $fields = $(
		'#beyondwords-plugin-settings .beyondwords-setting--preselect--post-type'
	);

	$fields.each( function () {
		if ( $( this ).find( '> label > input' ).is( ':checked' ) ) {
			$( this )
				.find( '.beyondwords-setting--preselect--taxonomy' )
				.hide();
		}
	} );

	$fields.on( 'change', '> label > input', function () {
		const $postType = $( this ).closest(
			'.beyondwords-setting--preselect--post-type'
		);
		if ( this.checked ) {
			$postType
				.find( '.beyondwords-setting--preselect--taxonomy' )
				.hide();
			$postType
				.find( '.beyondwords-setting--preselect--term input' )
				.prop( 'checked', false );
		} else {
			$postType
				.find( '.beyondwords-setting--preselect--taxonomy' )
				.show();
		}
	} );
} )( jQuery );

```
