[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 23:17:48 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             |  Resolution:
 Keywords:                     |     Focuses:
-------------------------------+------------------------------

Comment (by nicola.peluchetti):

 The correct code to replicate is

 {{{#!php
 <?php
 add_filter( 'image_send_to_editor', 'remove_width_attribute' , 10 );
 function remove_width_attribute( $html ) {
   $html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html );
   return $html;
 }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34823#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list