LLMS_Admin_User_Custom_Fields::output_instructors_assistant_scripts()

Output JS to handle user interaction with the instructor’s parent field


Description Description

Display custom field ONLY when creating/editing an instructor’s assistant.


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/admin/class.llms.admin.user.custom.fields.php

	public function output_instructors_assistant_scripts() {
		?>
		<script>
			( function( $ ) {
				var $role = $( '#role' ),
					$parent = $( '#llms-parent-instructors-table' );
				$role.closest( '.form-table' ).after( $parent );
				$role.on( 'change', function() {
					if ( 'instructors_assistant' === $( this ).val() ) {
						$parent.show();
					} else {
						$parent.hide();
					}
				} ).trigger( 'change' );
			} )( jQuery );
		</script>
		<?php
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.13.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.