Well after long research I find out solution,
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 });
}
Related Posts:
- Where is the WP auto-save draft JavaScript?
- What does l10n.js do in WordPress 3.1? And how do I remove it?
- Add a class to links in the visual editor (how to get old dialog back)
- Reset Undo on the tinymce editor
- Instantiate TinyMCE via JS ( rather than PHP/wp_editor )
- Force core to use .dev JavaScript files
- TinyMCE Button to Insert Multiple Lines of Text?
- How to add a “data-” attribute to the image tag of native gallery output
- TinyMCE in a div / textarea on frontend?
- How to wrap the content of the main tinyMCE editor with extra tags
- Instantiate TinyMCE via JS ( rather than PHP/wp_editor )
- Add Item to Custom TinyMCE Menu
- Insert shortcode in post editor from javascript (Visual / HTML)
- Add tinymce dynamically via Javascript
- Using wp_editor in TinyMCE WindowManager dialog
- How do I embed a Javascript form directly into a page?
- Close TinyMCE plugin window on click away
- Make TinyMCE checkbox that returns a value instead of true/false
- TypeError: window.tinyMCE.execInstanceCommand is not a function
- How to set callback to execute after all the tinyMCE editors have been initialized?
- Popup box when Clicking on Insert into post button in wordpress
- Adding and removing hidden buttons from WordPress Customizer Tinymce widget editor using javascript API
- WP TinyMCE (Full + media ) – 4.8 JS Init Dynamicly
- Change/Replace keyboard character on keypress while writing new post
- Tinymce.js editor in Chrome?
- wordpress 4.4 upgrade visual editor bullets select for not selected elements
- How to reference TinyMCE body in my script
- TinyMCE Javascript URL Question
- How to use WP switchEditors.switchto(this) JS function in your own script?
- How to use value from modal tinymce windowManager?
- WordPress 4.2 mce-views migration guide?
- How to integrate a different (JavaScript) editor in WordPress?
- Replacing & in JS code on pages
- How can I remove a specific item from an array?
- How to use Redirect in the new react-router-dom of Reactjs
- How to fix “Cannot read property ‘addEventListener’ of null” error [duplicate]
- What does [object Object] mean?
- Remove class using jQuery
- How do I check whether a checkbox is checked in jQuery?
- Babel 7 – ReferenceError: regeneratorRuntime is not defined
- How can I create a two dimensional array in JavaScript?
- Does JavaScript pass by reference?
- How to add jQuery code into HTML Page
- Pure JavaScript: a function like jQuery’s isNumeric()
- jquery SlideToggle effect in upward direction?
- Deleting array elements in JavaScript – delete vs splice
- How can I determine if a variable is ‘undefined’ or ‘null’?
- Cannot find module ‘@angular-devkit/core’
- iFrame onload JavaScript event
- Node.js Error: connect ECONNREFUSED
- How to move an element into another element?
- Is there an arraylist in Javascript?
- How to convert JSON object to JavaScript array?
- How can I display a JavaScript object?
- How to move all HTML element children to another parent using JavaScript?
- How to print HTML content on click of a button, but not the page?
- explode string in jquery
- Why is this jQuery click function not working?
- Simple average function in Javascript
- How to uncheck a radio button?
- How can I extract a number from a string in JavaScript?
- Angularjs: Error: [ng:areq] Argument ‘HomeController’ is not a function, got undefined
- Truncate a string straight JavaScript
- Is there a way to get element by XPath using JavaScript in Selenium WebDriver?
- Get class list for element with jQuery
- Print a div content using Jquery
- How can JavaScript save to a local file?
- Generating PDF files with JavaScript
- How to disable auto-start of “Node.js: Server-side JavaScript” when using Adobe Dreamweaver?
- What are the differences between JSON and JSONP?
- How do I call a JavaScript function on page load?
- Documentation for using JavaScript code inside a PDF file
- Glidejs with WordPress
- REST API: Backbone and custom endpoint
- Gutenberg custom block plugin with custom image sizes
- Can I make use of word-count.js in my own code?
- “Password Strength Unknown” Registration Issue
- When using the block.getSaveElement hook can you output different markup based on whether or not you are in the edit view or the live page view?
- Linking to Files in Root Directory Outside of WP Installation
- How do I add JavaScript that will execute on all my sites in Multisite?
- Only loads on the contact template page
- Min And Max Date With Date Format In Elementor Form Not Working
- Strange gibberish JavaScript in Editor – site hacked?
- Building a slide down search box in wordpress
- javascript conflict
- esc_js() breaks unicode sequences by removing the slash ‘\’ character
- How to load JS for specific screen size using wp_enqueue_script?
- Video script issue, JavaScript attribute remains ‘undefined’
- Why does a on Comment edit page submit the page?
- Where to paste Google Map Snippet / JavaScript / CSS for WordPress integration
- Setting Variable Path to Template Directory inside Script
- Dynamically add Js
- Contact Form 7 Conditional redirect
- How do i load javascript on a specific custom post template via functions.php?
- How to load WP_Editor JS files manually (with AJAX)?
- Multi-site customization
- Can’t change javascript files
- WordPress tinyMCE Keep Wrapping Tags To HTML Codes When Saving
- Live Time on WP showing weirdly [closed]
- Google Map JavaScript error after migrating