Skip to content Skip to sidebar Skip to footer

Listbox Return Wrong Value In Wordpress3.9

I used the listbox UI element in Wordpress 3.8, but it does not work in its newer version (3.9). I wrote this JS code to test it: (function() { var ICONS; var icon = function(id) {

Solution 1:

Just did some updates in your code:

var menuval=[];
var insertVar = function (val) {
    return function () { 
        editor.insertContent(val);
    }
};
for (var i = 0; i < SHORTCODES.length; i++) {
    var _id = SHORTCODES[i];
    var _code = SHORTCODE_EXE[i];
    var variable = insertVar(_code);
    //alert(_id+' '+ SHORTCODES[i]+' '+SHORTCODE_EXE[i]);
    menuval.push({text: _id, onclick: variable }); 
}

Post a Comment for "Listbox Return Wrong Value In Wordpress3.9"