HEX
Server: Apache/2
System: Linux server-80-13-140-150.da.direct 5.14.0-362.24.1.el9_3.0.1.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Apr 4 22:31:43 UTC 2024 x86_64
User: cpt (1004)
PHP: 8.1.24
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/cpt/public_html/wp-content/plugins/ultimate-member/assets/js/admin/block-renderer.js
jQuery(window).on( 'load', function($) {
	var observer = new MutationObserver(function(mutations) {
		mutations.forEach(function(mutation) {
			jQuery(mutation.addedNodes).find('.um.um-directory').each(function() {
				jQuery('.um-directory button').attr('disabled', 'disabled');
				jQuery('.um-directory a').attr('href', '');

				if ( typeof( jQuery.fn.select2 ) === 'function' ) {
					jQuery(".um-s1").each( function( e ) {
						var obj = jQuery(this);
						obj.select2({
							allowClear: true,
							dropdownParent: obj.parent()
						}).on( 'change', unselectEmptyOption );
					} );

					jQuery(".um-s2").each( function( e ) {
						var obj = jQuery(this);

						// fix https://github.com/ultimatemember/ultimatemember/issues/941
						// using .um-custom-shortcode-tab class as temporarily solution
						var atts = {};
						if ( obj.parents('.um-custom-shortcode-tab').length ) {
							atts = {
								allowClear: false
							};
						} else {
							atts = {
								allowClear: false,
								minimumResultsForSearch: 10,
								dropdownParent: obj.parent()
							};
						}
						obj.select2( atts ).on( 'change', unselectEmptyOption );
					} );

					jQuery(".um-s3").each( function( e ) {
						var obj = jQuery(this);

						obj.select2({
							allowClear: false,
							minimumResultsForSearch: -1,
							dropdownParent: obj.parent()
						}).on( 'change', unselectEmptyOption );
					} );
				}
			});
			jQuery(mutation.addedNodes).find('.um.um-profile').each(function() {
				jQuery('.um-profile input, .um-profile select, .um-profile button').attr('disabled', 'disabled');
				jQuery('.um-profile a').attr('href', '');
			});
			jQuery(mutation.addedNodes).find('.um.um-account').each(function() {
				jQuery('.um-account input, .um-account select, .um-account button').attr('disabled', 'disabled');
				jQuery('.um-account a').attr('href', '');
			});
			jQuery(mutation.addedNodes).find('.um.um-password').each(function() {
				jQuery('.um-password input, .um-password select, .um-password button').attr('disabled', 'disabled');
				jQuery('.um-password a').attr('href', '');
			});
		});
	});

	observer.observe(document, {attributes: false, childList: true, characterData: false, subtree:true});

});

function unselectEmptyOption( e ) {
	var $element = jQuery( e.currentTarget );
	var $selected = $element.find(':selected');

	if ( $selected.length > 1 ) {
		$selected.each( function ( i, option ) {
			if ( option.value === '' ) {
				option.selected = false;
				$element.trigger( 'change' );
			}
		});
	}
}``