export_add_js()WP 3.5.0

Display JavaScript on the page.

No Hooks.

Return

null. Nothing (null).

Usage

export_add_js();

Changelog

Since 3.5.0 Introduced.

export_add_js() code WP 6.6.2

<?php
function export_add_js() {
	?>
<script type="text/javascript">
	jQuery( function($) {
		var form = $('#export-filters'),
			filters = form.find('.export-filters');
		filters.hide();
		form.find('input:radio').on( 'change', function() {
			filters.slideUp('fast');
			switch ( $(this).val() ) {
				case 'attachment': $('#attachment-filters').slideDown(); break;
				case 'posts': $('#post-filters').slideDown(); break;
				case 'pages': $('#page-filters').slideDown(); break;
			}
		});
	} );
</script>
	<?php
}