Changeset 35106
- Timestamp:
- 10/13/2015 01:48:41 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widget-functions.php
r35104 r35106 950 950 } 951 951 952 $before_widget = sprintf('<div class="widget %s">', $widget_obj->widget_options['classname'] ); 953 $default_args = array( 'before_widget' => $before_widget, 'after_widget' => "</div>", 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>' ); 954 955 $args = wp_parse_args($args, $default_args); 952 $default_args = array( 953 'before_widget' => '<div class="widget %s">', 954 'after_widget' => "</div>", 955 'before_title' => '<h2 class="widgettitle">', 956 'after_title' => '</h2>', 957 ); 958 $args = wp_parse_args( $args, $default_args ); 959 $args['before_widget'] = sprintf( $args['before_widget'], $widget_obj->widget_options['classname'] ); 960 956 961 $instance = wp_parse_args($instance); 957 962 -
trunk/tests/phpunit/tests/widgets.php
r35100 r35106 608 608 } 609 609 } 610 611 function test_the_widget_custom_before_title_arg() { 612 613 ob_start(); 614 the_widget( 615 'WP_Widget_Text', 616 array( 'title' => 'Notes', 'text' => 'Sample text' ), 617 array( 'before_widget' => '<span class="special %s">', 'after_widget' => '</span>' ) 618 ); 619 $actual = ob_get_clean(); 620 621 $this->assertRegExp( '/<span class="special widget_text">/', $actual ); 622 623 } 624 610 625 }
Note: See TracChangeset
for help on using the changeset viewer.