Filters the list of attachment link attributes.
$attributesarray$idintwp-includes/post-template.php:1690wp_get_attachment_link() * @since 6.2.0 * * @param array $attributes An array of attributes for the link markup, * keyed on the attribute name. * @param int $id Post ID. */ $attributes = apply_filters( 'wp_get_attachment_link_attributes', array( 'href' => $url ), $_post->ID ); $link_attributes = ''; foreach ( $attributes as $name => $value ) { $value = 'href' === $name ? esc_url( $value ) : esc_attr( $value ); $link_attributes .= ' ' . esc_attr( $name ) . "='" . $value . "'"; }Introduced in 6.2.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.