Changeset 46163 for trunk/src/wp-includes/general-template.php
- Timestamp:
- 09/18/2019 12:24:35 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r46154 r46163 1736 1736 */ 1737 1737 function get_archives_link( $url, $text, $format = 'html', $before = '', $after = '', $selected = false ) { 1738 $text = wptexturize( $text ); 1739 $url = esc_url( $url ); 1740 1741 if ( 'link' == $format ) { 1738 $text = wptexturize( $text ); 1739 $url = esc_url( $url ); 1740 $aria_current = $selected ? ' aria-current="page"' : ''; 1741 1742 if ( 'link' === $format ) { 1742 1743 $link_html = "\t<link rel='archives' title='" . esc_attr( $text ) . "' href='$url' />\n"; 1743 } elseif ( 'option' == $format ) {1744 } elseif ( 'option' === $format ) { 1744 1745 $selected_attr = $selected ? " selected='selected'" : ''; 1745 1746 $link_html = "\t<option value='$url'$selected_attr>$before $text $after</option>\n"; 1746 } elseif ( 'html' == $format ) {1747 $link_html = "\t<li>$before<a href='$url' >$text</a>$after</li>\n";1747 } elseif ( 'html' === $format ) { 1748 $link_html = "\t<li>$before<a href='$url'$aria_current>$text</a>$after</li>\n"; 1748 1749 } else { // custom 1749 $link_html = "\t$before<a href='$url' >$text</a>$after\n";1750 $link_html = "\t$before<a href='$url'$aria_current>$text</a>$after\n"; 1750 1751 } 1751 1752
Note: See TracChangeset
for help on using the changeset viewer.