[wp-trac] [WordPress Trac] #34823: image_send_to_editor filter is not fired when an Image is edited or replaced in TinyMce
WordPress Trac
noreply at wordpress.org
Tue Dec 1 17:31:44 UTC 2015
#34823: image_send_to_editor filter is not fired when an Image is edited or
replaced in TinyMce
-------------------------------+-----------------------------
Reporter: nicola.peluchetti | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: TinyMCE | Version: 4.3.1
Severity: normal | Keywords:
Focuses: |
-------------------------------+-----------------------------
image_send_to_editor filter should be called every time an image is
modified/replaced in TinyMce, right now it looks like it's called only
when the image is inserted.
To replicate
add_filter( 'image_send_to_editor', 'remove_width_attribute' , 10
);
public static function remove_width_attribute( $html ) {
$html = preg_replace( '/(width|height)=\"\d*\"\s/', "",
$html );
return $html;
}
Add an image with TinyMce. The Html will have no height/width attributes.
Edit the added image, change the "Link To" for example and update it, the
html will have height/width and the filter is not called.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34823>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list