Callback function quicktags that uses variable in start tag

Managed to find out how: function callback_wrap(e, c, ed) { var course = getSelectedText(“_lesson_course”); var module_info = jQuery(“#title”).val(); var module_nr = module_info.match( /\d+/g ); var start = ed.canvas.selectionStart; var end = ed.canvas.selectionEnd; var content = jQuery(“#content”).val(); console.log(start); console.log(end); console.log(ed); var selected = content.slice(start, end); var string = ‘<div class=”moudle-area”>’+selected+'<p>[Tweet “I just completed Module ‘+module_nr+’ of … Read more

Adding a Media Button to the WordPress Content Editor

According to what you have posted, the action “wp_enqueue_media” is missing for the function “include_media_button_js_file”. In this case, the JavaScript file “media_button.js” would never be loaded. By the way, the function “wp.media” opens the media dialog for uploading or selecting images. However, you cannot enter any text in this dialog. Maybe the following example will … Read more