[wp-trac] [WordPress Trac] #41623: Wide widgets in Customizer fail set max-height on wrong container for Text and Media widgets

WordPress Trac noreply at wordpress.org
Sun Aug 13 05:32:04 UTC 2017


#41623: Wide widgets in Customizer fail set max-height on wrong container for Text
and Media widgets
--------------------------+-----------------
 Reporter:  westonruter   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  4.9
Component:  Customize     |    Version:  4.8
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------
 The Text widget and Media widgets put their controls outside of the
 `.widget-content` element since it gets replaced with fields from the
 server with each save, and since these widgets have JS-managed fields this
 eliminates the need to re-initialize the fields (with a flicker) every
 time the widget is saved.

 For “wide widgets” in the Customizer, the widget is positioned in a way
 that it can be floated over the preview for more room. However, the Text
 and Media widgets when extended (and wide) will currently appear too tall
 because the `max-height` is still set on `.widget-content` when instead it
 needs to be set on the parent `.form` element.

 Easy way to reproduce the problem is to add an `mu-plugin` with the
 following:

 {{{#!php
 <?php
 require_once ABSPATH . '/wp-includes/widgets/class-wp-widget-text.php';

 class Extended_Text_Widget extends WP_Widget_Text {
         function __construct() {
                 parent::__construct();
                 $this->id_base = 'extended_text';
                 $this->name = __( 'Extended Text' );
                 $this->option_name = 'widget_' . $this->id_base;
                 $this->widget_options['description'] = __( 'Extended
 arbitrary text.' );
                 $this->control_options['id_base'] = $this->id_base;
         }
 }
 add_action( 'widgets_init', function() {
         register_widget( 'Extended_Text_Widget' );
 } );
 }}}

 If you add this widget in the Customizer, you'll see it takes up the
 entire vertical space instead of just the space needed for the editor.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41623>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list