attachment_link

过滤钩子
apply_filters( 'attachment_link', $link, $post->ID )
参数
  • (string) $link The attachment's permalink.
    Required:
  • (int) $post_id Attachment ID.
    Required:
定义位置
相关勾子
comment_linkget_comment_linkget_comments_linkedit_comment_linkpost_comments_link
相关方法
the_attachment_linkget_attachment_linkthe_attachment_links_fix_attachment_linkswp_get_attachment_linkget_the_attachment_link
引入
5.6.0
弃用
-

attachment_link: 这个过滤器允许开发者修改WordPress中附件的链接。这可以用来改变附件所显示的URL。

过滤附件的固定链接。

return apply_filters( 'attachment_link', $link, $post->ID );

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2026-03-15 16:37:22

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: