wp_get_attachment_link_attributes

wp_get_attachment_link_attributes

Appears in:
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.2

apply_filters('wp_get_attachment_link_attributes') is found 1 times:

  • /wp-includes/post-template.php line 1678
    1674
    1675
    1676
    1677
    1678
    1679
    1680
    1681
    1682
    1683
    1684
    * @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 . "'";
    }