wp_get_attachment_link_attributes
wp_get_attachment_link_attributes
Appears in: wordpress-6.2, wordpress-6.2.1, wordpress-6.2.2, wordpress-6.3, wordpress-6.3.1, wordpress-6.3.2, wordpress-6.4, wordpress-6.4.1, wordpress-6.4.2, wordpress-6.4.3, wordpress-6.5, wordpress-6.5.2, wordpress-6.5.3, wordpress-6.5.4, wordpress-6.5.5, wordpress-6.6, wordpress-6.6.1, wordpress-6.6.2, wordpress-6.7, wordpress-6.7.1, wordpress-6.7.2
Hook Type: filter
Displaying hooks found in version: wordpress-6.7.2apply_filters('wp_get_attachment_link_attributes') is found 1 times:
- /wp-includes/post-template.php line 168016761677167816791680168116821683168416851686
* @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
.
"'"
;
}