Make WordPress Core

Changeset 44471


Ignore:
Timestamp:
01/08/2019 09:08:06 AM (8 years ago)
Author:
pento
Message:

Media: Add $attr to the wp_get_attachment_link filter.

Props danielbachhuber.
Fixes #40155.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-template.php

    r44411 r44471  
    16031603         *
    16041604         * @since 2.7.0
     1605         * @since 5.1.0 Added the $attr parameter.
    16051606         *
    16061607         * @param string       $link_html The page link HTML output.
    … …  
    16111612         * @param bool         $icon      Whether to include an icon. Default false.
    16121613         * @param string|bool  $text      If string, will be link text. Default false.
     1614         * @param array|string $attr      Array or string of attributes. Default empty.
    16131615         */
    1614         return apply_filters( 'wp_get_attachment_link', "<a href='" . esc_url( $url ) . "'>$link_text</a>", $id, $size, $permalink, $icon, $text );
     1616        return apply_filters( 'wp_get_attachment_link', "<a href='" . esc_url( $url ) . "'>$link_text</a>", $id, $size, $permalink, $icon, $text, $attr );
    16151617}
    16161618
Note: See TracChangeset for help on using the changeset viewer.