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
This commit is contained in:
Dominik Schilling (ocean90) 2015-03-11 20:43:25 +00:00
parent 22f174c106
commit bea0628880
1 changed files with 6 additions and 0 deletions

View File

@ -814,6 +814,12 @@ function register_sidebar($args = array()) {
'after_title' => "</h2>\n",
);
if ( current_theme_supports( 'html5', 'widgets' ) ) {
$defaults['before_widget'] = '<aside id="%1$s" class="widget %2$s">';
$defaults['after_widget'] = "</aside>\n";
$defaults['before_title'] = '<h2 class="widget-title">';
}
$sidebar = wp_parse_args( $args, $defaults );
$wp_registered_sidebars[$sidebar['id']] = $sidebar;