WordPress.org

Make WordPress Core

Ticket #19450: 19450.diff

File 19450.diff, 1013 bytes (added by coffee2code, 2 years ago)
  • wp-includes/widgets.php

     
    11251125        if ( !is_a($widget_obj, 'WP_Widget') ) 
    11261126                return; 
    11271127 
    1128         $before_widget = sprintf('<div class="widget %s">', $widget_obj->widget_options['classname'] ); 
    1129         $default_args = array( 'before_widget' => $before_widget, 'after_widget' => "</div>", 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>' ); 
     1128        $default_args = array( 
     1129                'before_widget' => '<div class="widget %s">', 
     1130                'after_widget' => "</div>", 
     1131                'before_title' => '<h2 class="widgettitle">', 
     1132                'after_title' => '</h2>', 
     1133        ); 
     1134        $args = wp_parse_args( $args, $default_args ); 
     1135        $args['before_widget'] = sprintf( $args['before_widget'], $widget_obj->widget_options['classname'] ); 
    11301136 
    1131         $args = wp_parse_args($args, $default_args); 
    11321137        $instance = wp_parse_args($instance); 
    11331138 
    11341139        do_action( 'the_widget', $widget, $instance, $args );