From bea062888089995c3af42267bb3310b856fd7631 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Wed, 11 Mar 2015 20:43:25 +0000 Subject: [PATCH] Introduce HTML5 widgets support. When a theme supports HTML5 widgets via `add_theme_support( 'html5', 'widgets' )`, aside will be used instead of list markup. props LeoPeo, valendesigns. fixes #30556. git-svn-id: https://develop.svn.wordpress.org/trunk@31729 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/widgets.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wp-includes/widgets.php b/src/wp-includes/widgets.php index 40bf54c528..229b5ec29b 100644 --- a/src/wp-includes/widgets.php +++ b/src/wp-includes/widgets.php @@ -814,6 +814,12 @@ function register_sidebar($args = array()) { 'after_title' => "\n", ); + if ( current_theme_supports( 'html5', 'widgets' ) ) { + $defaults['before_widget'] = '\n"; + $defaults['before_title'] = '

'; + } + $sidebar = wp_parse_args( $args, $defaults ); $wp_registered_sidebars[$sidebar['id']] = $sidebar;