Skip to content

Commit

Permalink
Render archives list container as ul when a list and div when a d…
Browse files Browse the repository at this point in the history
…ropdown
  • Loading branch information
talldan committed Jul 16, 2018
1 parent 0696d4c commit 65025c1
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions core-blocks/archives/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ function render_block_core_archives( $attributes ) {
$block_content = '<label class="screen-reader-text" for="' . $dropdown_id . '">' . $title . '</label>
<select id="' . $dropdown_id . '" name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
<option value="">' . $label . '</option>' . $archives . '</select>';

$block_content = sprintf(
'<div class="%1$s">%2$s</div>',
esc_attr( $class ),
$block_content
);
} else {

/** This filter is documented in wp-includes/widgets/class-wp-widget-archives.php */
Expand All @@ -68,13 +74,13 @@ function render_block_core_archives( $attributes ) {
$archives_args['echo'] = 0;

$block_content = wp_get_archives( $archives_args );
}

$block_content = sprintf(
'<div class="%1$s">%2$s</div>',
esc_attr( $class ),
$block_content
);
$block_content = sprintf(
'<ul class="%1$s">%2$s</ul>',
esc_attr( $class ),
$block_content
);
}

return $block_content;
}
Expand Down

0 comments on commit 65025c1

Please sign in to comment.