only overwrite the send_to_editor function when your link or button is click but store the old function to restore it so try this on a click event:
//store old send to editor function
window.restore_send_to_editor = window.send_to_editor;
//overwrite send to editor function
window.send_to_editor = function(html) {
var imgurl = jQuery('img',html).attr('src');
current_item.siblings('.upload_image').val(imgurl);
current_item.parent().prepend('<div><img width="300" src="'+imgurl+'" alt="banner image" /></div>');
tb_remove();
//restore old send to editor function
window.send_to_editor = window.restore_send_to_editor;
}
Related Posts:
- How to get attachment id as soon as it is uploaded through media uploader in jquery?
- Add tinymce buttons to caption textarea in media uploader
- How to change the text of the “You are about to permanently delete these items…” alert message when deleting media from the media library?
- What does [object Object] mean? (JavaScript)
- Why does my JavaScript code receive a “No ‘Access-Control-Allow-Origin’ header is present on the requested resource” error, while Postman does not?
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- My javascript is returning this error: $.ajax is not a function
- Javascript Runtime error: $ is undefined
- Javascript TypeError: Cannot read property ‘indexOf’ of undefined
- javascript function wait until another function to finish
- How to read data From *.CSV file using javascript?
- How to call a webservice method from an html page [javascript] with out refresh the page
- How can I remove all CSS classes using jQuery/JavaScript?
- I want to enqueue a .js file to my child theme
- Is there a way to enable Cross-Origin Resource Sharing for WordPress’ ajaxurl?
- Using ‘$’ instead of ‘jQuery’ in WordPress
- jQuery UI Datepicker not working
- Automatically decrease font size for long words
- Extend 3.5 media uploader plugin to change button name
- Draggable item in custom gutenberg block
- Javascript included but alert() function not working
- jQuery Hoverintent plugin in TwentyEleven Menu [closed]
- How wp_enqueue_script works?
- Script won’t execute in the media manager
- jQuery Validate wp_editor
- How to properly add Bootstrap and JQuery Javascripts?
- WordPress Jquery Fade in, Fade out effect
- wp_ajax unauthenticated and authenticated
- WordPress ajax function parameter value not being passed
- Is it safe to include a javascript file in a template’s php file?
- WP Admin missing icons, numerous JavaScript errors, but only when SCRIPT_DEBUG is false
- wpColorPicker: How update colors on input value update?
- Gutenberg Filtering Metaboxes by Post Format
- JSON output returns page source code [closed]
- Getting all URLs of uploaded images using media uploader
- No data received
- `wp_editor()` CSS messing up the jQuery Dialog
- Dealing with a library that depends on jQuery
- CodeMirror on Custom Widget Textarea
- Sending click events to Google Analytics in WordPress: the easy way
- How to embed JS data viz in a simple WordPress website
- start.js:45TypeError: Not enough arguments on Safari [closed]
- Rhyzz Repeatable-fields javascript in php and wordpress
- Help with a jQuery Carousel
- “send_to_editor” function returning pdf file name
- videopress videos are not displayed when loading the content with ajax in a lightbox
- Call a javascript function from another file
- Fall Back Google CDN in JavaScript
- Yoast SEO breaking media upload
- window.onload wont execute in wordpress
- How to return multiple arguments from AJAX callback function
- JS news ticker is not working on home page but working on other pages. How to solve this?
- WP Customizer compare and set a value via javascript
- Why doesn’t jQuery use $, and how can I get it do so (GLOBALLY)?
- I have an old version of jQuery showing up. How do I figure out where it is coming from?
- Plugin Scripts no loading on options page
- How do I include javascript/jquery image resizing with wordpress?
- Search input area autogrow – how?
- Using jquery and javascript in WordPress
- Get value of selected option in select field in a WordPress form
- Unable to get my javascript to work on my website – what am I doing wrong?
- Multiple Media uploader output to input
- Using WP functions inside javascript
- How to add external remote JS source to Gravity Forms?
- Screen Options JavaScript Code
- Is there some jQuery conflict here?
- Dynamic WordPress editor in meta box
- Theme has superfish – how to add supersubs?
- wordpress file upload from direct directory not working
- Form validation before submitting
- How to make JQuery load on top of head tag before everything
- Show and hide element when URL contains certain section of text?
- Defer Parsing of Scripts
- Orderby post__in Not Working Correctly?
- Site images are fixed in front of my site content [closed]
- JavaScript code do not works on online server
- Notify user we would like them to clear their cookie. Provide a working button to clear cookies for user
- jQuery not working for media uploader
- Call full image url instead of stylsheet directory url in JS for Infinite Scroll Function
- How to toggle custom WP archive list
- comment-reply.js disables any other form javascript
- How to blur the_post_thumbnail() via blur.js (jquery)?
- Custom Javascript not working? [closed]
- Displaying contents of a tab
- How to deregister scripts all at once
- Uncaught TypeError: undefined is not a function (shortcode-box)
- Running javascript in a child theme. Works in jsfiddle
- How to block action if post is “dirty”?
- WordPress video end function [duplicate]
- Trying to get fittext to work in WordPress
- Add jQuery function to media button
- How to Run a jQuery Script after a Javascript Script has Finished in WordPress
- TypeError: $ is not a function Error using parallax effect in WordPress Template [duplicate]
- Ensure an external javascript file called from plugin is loaded after jquery is called
- Why my vertical tab js code is refreshing the page continuously? [closed]
- bootstrap-slider.js by seiyria not working in wordpress
- jQuery append only works if I select html in admin section [closed]
- Javascript Loading Effect to URLs
- Use WordPress Built In Jquery