HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/azvo/wp-content/plugins/sitepress-multilingual-cms/res/js/wpml-simple-language-selector.js
var WPML_Core = WPML_Core || {};

WPML_Core.SimpleLanguageSelector = function () {
	var self         = this;

	var init = function () {
        jQuery(function () {
            self.initialize_select2();
        });
    };

    var add_flags = function ( state ) {
        if (!state.id) { return state.text; }

        var text = state.text;
        if (jQuery(state.element).data('status') == 'active' ) {
            text = '<strong>&nbsp;' + text + '</strong>';
        }

        return '<img width="18" height="12" src="' + jQuery(state.element).data('flag_url') + '"/> ' + text;
    };

    self.initialize_select2 = function () {
        jQuery('.js-simple-lang-selector-flags').wpml_select2({
            formatResult:       add_flags,
            formatSelection:    add_flags,
            width:              'auto',
            dropdownCss:        {'z-index': parseInt(jQuery('.ui-dialog').css('z-index'), 10) + 100},
            dropdownAutoWidth:  true
        });

        var lang_selector_flags = jQuery('.js-simple-lang-selector-flags');

        if (lang_selector_flags.is(':disabled')) {
            lang_selector_flags.find('.wpml_select2-choice').addClass('button button-secondary').attr('disabled', 'true');
        }
	};

	init();

};

WPML_Core.simple_language_selector = new WPML_Core.SimpleLanguageSelector();