WordPress.org

Make WordPress Core

Changeset 31729


Ignore:
Timestamp:
03/11/2015 08:43:25 PM (3 years ago)
Author:
ocean90
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets.php

    r31685 r31729  
    814814        'after_title' => "</h2>\n",
    815815    );
     816
     817    if ( current_theme_supports( 'html5', 'widgets' ) ) {
     818        $defaults['before_widget'] = '<aside id="%1$s" class="widget %2$s">';
     819        $defaults['after_widget'] = "</aside>\n";
     820        $defaults['before_title'] = '<h2 class="widget-title">';
     821    }
    816822
    817823    $sidebar = wp_parse_args( $args, $defaults );
Note: See TracChangeset for help on using the changeset viewer.