WordPress.org

Make WordPress Core

Ticket #41057: 41057.2.diff

File 41057.2.diff, 2.5 KB (added by pento, 2 months ago)
  • src/wp-admin/includes/widgets.php

     
    181181        $id_format = $widget['id']; 
    182182        $widget_number = isset($control['params'][0]['number']) ? $control['params'][0]['number'] : ''; 
    183183        $id_base = isset($control['id_base']) ? $control['id_base'] : $widget_id; 
     184        $width = isset($control['width']) ? $control['width'] : ''; 
     185        $height = isset($control['height']) ? $control['height'] : ''; 
    184186        $multi_number = isset($sidebar_args['_multi_num']) ? $sidebar_args['_multi_num'] : ''; 
    185187        $add_new = isset($sidebar_args['_add']) ? $sidebar_args['_add'] : ''; 
    186188 
     
    244246        } else { 
    245247                echo "\t\t<p>" . __('There are no options for this widget.') . "</p>\n"; 
    246248        } 
     249 
     250        $noform_class = ''; 
     251        if ( 'noform' === $has_form ) { 
     252                $noform_class = ' widget-control-noform'; 
     253        } 
    247254        ?> 
    248255        <?php echo $after_widget_content; ?> 
    249256        <input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr($id_format); ?>" /> 
    250257        <input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr($id_base); ?>" /> 
    251         <input type="hidden" name="widget-width" class="widget-width" value="<?php if (isset( $control['width'] )) echo esc_attr($control['width']); ?>" /> 
    252         <input type="hidden" name="widget-height" class="widget-height" value="<?php if (isset( $control['height'] )) echo esc_attr($control['height']); ?>" /> 
     258        <input type="hidden" name="widget-width" class="widget-width" value="<?php echo esc_attr($width); ?>" /> 
     259        <input type="hidden" name="widget-height" class="widget-height" value="<?php echo esc_attr($height); ?>" /> 
    253260        <input type="hidden" name="widget_number" class="widget_number" value="<?php echo esc_attr($widget_number); ?>" /> 
    254261        <input type="hidden" name="multi_number" class="multi_number" value="<?php echo esc_attr($multi_number); ?>" /> 
    255262        <input type="hidden" name="add_new" class="add_new" value="<?php echo esc_attr($add_new); ?>" /> 
     
    262269                                <button type="button" class="button-link widget-control-close"><?php _e( 'Done' ); ?></button> 
    263270                        </span> 
    264271                </div> 
    265                 <div class="alignright<?php if ( 'noform' === $has_form ) echo ' widget-control-noform'; ?>"> 
     272                <div class="alignright<?php echo $noform_class; ?>"> 
    266273                        <?php submit_button( __( 'Save' ), 'primary widget-control-save right', 'savewidget', false, array( 'id' => 'widget-' . esc_attr( $id_format ) . '-savewidget' ) ); ?> 
    267274                        <span class="spinner"></span> 
    268275                </div>