mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 15:08:10 +01:00
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:
parent
8355845b8a
commit
b5a06f7695
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
@ -814,6 +814,12 @@ function register_sidebar($args = array()) {
|
|||||||
'after_title' => "</h2>\n",
|
'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 );
|
$sidebar = wp_parse_args( $args, $defaults );
|
||||||
|
|
||||||
$wp_registered_sidebars[$sidebar['id']] = $sidebar;
|
$wp_registered_sidebars[$sidebar['id']] = $sidebar;
|
||||||
|
Loading…
Reference in New Issue
Block a user