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.
Built from https://develop.svn.wordpress.org/trunk@31729


git-svn-id: http://core.svn.wordpress.org/trunk@31710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2015-03-11 20:44:25 +00:00
parent 8355845b8a
commit b5a06f7695
2 changed files with 7 additions and 1 deletions

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-alpha-31728';
$wp_version = '4.2-alpha-31729';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

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;