wp_get_attachment_link_attributes

wp_get_attachment_link_attributes

Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.5.2

apply_filters('wp_get_attachment_link_attributes') is found 1 times:

  • /wp-includes/post-template.php line 1676
    	 * @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 . "'";
    	}