: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
var WPML_Core = WPML_Core || {};
WPML_Core.SimpleLanguageSelector = function () {
jQuery(document).ready(function() {
self.initialize_select2();
var add_flags = function ( state ) {
if (!state.id) { return state.text; }
if (jQuery(state.element).data('status') == 'active' ) {
text = '<strong> ' + 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').select2({
formatSelection: add_flags,
escapeMarkup: function(m) { return m; },
dropdownCss: {'z-index': parseInt(jQuery('.ui-dialog').css('z-index'), 10) + 100},
var lang_selector_flags = jQuery('.js-simple-lang-selector-flags');
if (lang_selector_flags.is(':disabled')) {
lang_selector_flags.find('.select2-choice').addClass('button button-secondary').attr('disabled', 'true');
WPML_Core.simple_language_selector = new WPML_Core.SimpleLanguageSelector();