Skip to content

Commit

Permalink
Use ul-tag if back-links in list.
Browse files Browse the repository at this point in the history
  • Loading branch information
kebbet committed Oct 5, 2021
1 parent 7a52445 commit 9eb836d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/listing.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ function display( $content ) {
$title = apply_filters( 'kebbet_shortcode_footnote_list_title', __( 'Footnotes', 'kebbet-shortcode-footnotes' ) );
$title_tag = apply_filters( 'kebbet_shortcode_footnote_list_title_tag', 'h3' );
$wrap_class = apply_filters( 'kebbet_shortcode_footnote_list_wrap_class', 'footnotes-wrap' );
$list_tag = 'ol';

if ( is_admin() ) {
return $content;
}

if ( true === \kebbet\footnotes\settings\back_link() ) {
$wrap_class .= ' back-links';
$list_tag = 'ul';
}

$notes_content = get_post_footnotes();
Expand All @@ -52,9 +54,9 @@ function display( $content ) {

$list_content = '<div class="' . esc_attr( $wrap_class ) . '">';
$list_content .= '<' . $title_tag . '>' . $title . '</' . $title_tag . '>';
$list_content .= '<ol class="footnotes-list">';
$list_content .= '<' . $list_tag . ' class="footnotes-list">';
$list_content .= $notes_list;
$list_content .= '</ol>';
$list_content .= '</' . $list_tag . '>';
$list_content .= '</div>';

// Append the list.
Expand Down

0 comments on commit 9eb836d

Please sign in to comment.