[wp-trac] [WordPress Trac] #37069: WP Color Picker has no appropriate disable / destroy method.

WordPress Trac noreply at wordpress.org
Thu May 2 19:30:18 UTC 2024


#37069: WP Color Picker has no appropriate disable / destroy method.
--------------------------+-----------------------------------------
 Reporter:  Aniruddh      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  General       |     Version:  4.5.2
 Severity:  normal        |  Resolution:  wontfix
 Keywords:                |     Focuses:  javascript, administration
--------------------------+-----------------------------------------

Comment (by alexvorn2):

 what I made to make this work, only this code:

 {{{
 $( DIV SELECTOR ).find( '.YOUR INPUT CLASS NAME' ).each( function() {
         var t = $( this );

         t.removeClass( 'wp-color-picker' );

         var t_clone = t.clone();

         var t_color_picker = t.parent().parent().parent();

         if ( t_color_picker.hasClass( 'wp-picker-container' ) ) {
                 t_color_picker.before( t_clone );
                 t_color_picker.detach();
         }

         // seems not working for some reason
         // t.wpColorPicker( 'destroy' );
 } );

 }}}

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


More information about the wp-trac mailing list