wp-includes/general-template.php:2133Retrieves archive link content based on predefined or custom code.
$urlstring$textstring$formatstringoptional'html'$beforestringoptional''$afterstringoptional''$selectedbooloptionalfalsestringOne hook fires while get_archives_link() runs, in this order:
Filters the archive link content.
function get_archives_link( $url, $text, $format = 'html', $before = '', $after = '', $selected = false ) { $text = wptexturize( $text ); $url = esc_url( $url ); $aria_current = $selected ? ' aria-current="page"' : ''; if ( 'link' === $format ) { $link_html = "\t<link rel='archives' title='" . esc_attr( $text ) . "' href='$url' />\n"; } elseif ( 'option' === $format ) { $selected_attr = $selected ? " selected='selected'" : ''; $link_html = "\t<option value='$url'$selected_attr>$before $text $after</option>\n"; } elseif ( 'html' === $format ) { $link_html = "\t<li>$before<a href='$url'$aria_current>$text</a>$after</li>\n"; } else { // Custom. $link_html = "\t$before<a href='$url'$aria_current>$text</a>$after\n"; } /** * Filters the archive link content. * * @since 2.6.0 * @since 4.5.0 Added the `$url`, `$text`, `$format`, `$before`, and `$after` parameters. * @since 5.2.0 Added the `$selected` parameter. * * @param string $link_html The archive HTML link content. * @param string $url URL to archive. * @param string $text Archive text description. * @param string $format Link format. Can be 'link', 'option', 'html', or custom. * @param string $before Content to prepend to the description. * @param string $after Content to append to the description. * @param bool $selected True if the current page is the selected archive. */ return apply_filters( 'get_archives_link', $link_html, $url, $text, $format, $before, $after, $selected );}Introduced in 1.0.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/general-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.