[wp-trac] [WordPress Trac] #43125: Deregistering WP_Widget_Media_Image breaks Text widget's "Add Media" button

WordPress Trac noreply at wordpress.org
Mon Jan 22 10:53:28 UTC 2018


#43125: Deregistering WP_Widget_Media_Image breaks Text widget's "Add Media" button
---------------------------+-----------------------
 Reporter:  standardspace  |       Owner:
     Type:  defect (bug)   |      Status:  reopened
 Priority:  normal         |   Milestone:  4.9.3
Component:  Widgets        |     Version:  4.9
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:
---------------------------+-----------------------

Comment (by standardspace):

 Hi Weston,
 I've tested that on a clean wp install all seems to work as I would
 expect.

 I've added the following to my functions.php :

 {{{#!php
 <?php
 add_action( 'widgets_init', function() {
     unregister_widget( 'WP_Widget_Media_Image' );
     unregister_widget( 'WP_Widget_Media_Audio' );
     unregister_widget( 'WP_Widget_Media_Video' );
     unregister_widget( 'WP_Widget_Media_Gallery' );
 } );

 }}}

 and the Text widget's "Add Media" was able to function without the other
 media widgets present.

 Looks like a fix. Thanks

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


More information about the wp-trac mailing list