From comments:
You have to use the image_send_to_editor filter to filter the string before it arrives at the window.send_to_editor javascript function.
add_filter('image_send_to_editor', 'my_image_send_to_editor', 10, 2);
function my_image_send_to_editor($html, $id)
{
$description = str_replace("\r\n",' ', $description);
}
Related Posts:
- Show only images and videos in a wp.media window
- Open media frame and select an attachment
- Switch to the library tab in the media uploader
- Restrict file types in the uploader of a wp.media frame
- Sending custom data with Media Frame Model
- Only displaying zip files with wp media
- How to retrieve a value from an input field in a media view template
- Uppload image from another source wp.media
- Multiple media uploader buttons target only one input on the same page
- Building a Featured Gallery component for Gutenberg
- Dynamically creating charts of each row in an HTML table with chart.js
- Google reCAPTCHA V3.0 not working. “ERROR for site owner: Invalid key type”
- Javascript split regex question
- Failed to load resource: the server responded with a status of 500 (Internal Server Error) in Bind function
- Scroll to an element with jQuery
- Cannot open local file – Chrome: Not allowed to load local resource
- How do you reverse a string in-place in JavaScript?
- How to set NODE_ENV to production/development in OS X
- How fix ‘Failed to load resource: the server responded with a status of 403’?
- Uncaught TypeError: Cannot read property ‘length’ of undefined
- Python to JavaScript converter
- Set style using pure JavaScript
- Check if element exists in jQuery
- Checking a Url in Jquery/Javascript
- Usage of the backtick character (`) in JavaScript
- Why is using “for…in” for array iteration a bad idea?
- Parsing a string to a date in JavaScript
- AJAX response error: net::ERR_EMPTY_RESPONSE
- TypeError: Cannot Set property ‘onclick’ of null
- Sorting strings in descending order in Javascript (Most efficiently)?
- Mismatched anonymous define() module
- Function is not defined – Uncaught ReferenceError
- Convert UTC date time to local date time
- How can I convert a string to boolean in JavaScript?
- “.addEventListener is not a function” why does this error occur?
- How do I include a JavaScript file in another JavaScript file?
- Textarea Auto height
- Angular 2 – Using ‘this’ inside setTimeout
- Download data URL file
- Why use Redux over Facebook Flux?
- What language is JavaScript written in?
- How to output numbers with leading zeros in JavaScript?
- Remove not alphanumeric characters from string
- Scroll to bottom of div?
- Open URL in new window with JavaScript
- Read XML file using javascript
- how to display a div triggered by onclick event
- Detect a finger swipe through JavaScript on the iPhone and Android
- How to change the text of a label?
- How to check ‘undefined’ value in jQuery
- Detecting arrow key presses in JavaScript
- JAX post error : Refused to set unsafe header “Connection”
- How to use onBlur event on Angular2?
- img onclick call to JavaScript function
- Bootstrap Collapse not Collapsing
- How to scroll to top of page with JavaScript/jQuery?
- Check if a JavaScript string is a URL
- Submit form without reloading page [duplicate]
- “React.Children.only expected to receive a single React element child” error when putting
and in a - What is the difference between Bower and npm?
- How to embed an autoplaying YouTube video in an iframe?
- Cannot read property ‘style’ of undefined — Uncaught Type Error
- clearInterval() not working [duplicate]
- How to make HTML element resizable using pure Javascript?
- how to use addHTML function in jsPDF
- How to use Head JS with all enqueued scripts?
- Custom “Uploads” Dir: “Edit Image” in Media Library broken
- Customizer JS API: Adding Setting Dynamically Not Working
- How to check if customize previewer is refreshing?
- Customizer JS API: Adding a “dropdown-pages” control
- Morris.js for WordPress?
- Where is the WP auto-save draft JavaScript?
- wp.editor.initialize does nothing
- Render blocking issue in google page insight
- Adding nonce or hashes to inline scripts
- Open MediaUpload from external component in Gutenberg
- WordPress Media Library: Custom tab content displayed in “Media Library” tab
- Manually mark imported photo as selected in media library
- How to retrieve data from database, then pass it to Javascript?
- Weird links found in wordpress footer
- Easy popups for wordpress?
- Limit filetype and wp media
- Why WordPress not using JSON_UNESCAPED_UNICODE by default?
- Install GTM in pure javascript through functions.php
- Add script to page at certain location in wordpress
- Absolutely print script in footer
- how to let users upload their custom cover image
- how to use nimble-API and Display data?
- How do you create your own link preview for my website?
- Can’t get rid of JQMIGRATE: Migrate is installed, version 3.3.2. Manually updated all the libralies and site. 5.8.2
- Need help in fixing javascript in WordPress
- Redirect to homepage if attmpting to leave intranet [closed]
- Why does my media selection script write to ONLY the first input field?
- Twenty seventeen theme dropdown menu issue
- How to correctly load this jquery script through the file functions.php?
- Unserialize WP_Options options programatically?
- javascript errors on mobile browser, not on desktop
- Adding react app to an existing wordpress website
- Javascript file not included only on home page
- Get current day using javascript [closed]