WordPress.org

Make WordPress Core

Ticket #9701: 9701.2.diff

File 9701.2.diff, 911 bytes (added by Denis-de-Bernardy, 5 years ago)

fix the sprintf when $args[before_widget] is passed

  • wp-includes/widgets.php

     
    12091209        if ( !is_a($widget_obj, 'WP_Widget') ) 
    12101210                return; 
    12111211 
    1212         $before_widget = sprintf('<div class="widget %s">', $widget_obj->widget_options['classname']); 
    1213         $default_args = array('before_widget' => $before_widget, 'after_widget' => "</div>", 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>'); 
     1212        $default_args = array('before_widget' => '<div class="widget %s">', 'after_widget' => "</div>", 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>'); 
    12141213 
    12151214        $args = wp_parse_args($args, $default_args); 
     1215        $args['before_widget'] = sprintf($args['before_widget'], $widget_obj->widget_options['classname']); 
    12161216        $instance = wp_parse_args($instance); 
    12171217 
    12181218        $widget_obj->_set(-1);