钩子文档

edit_post_link

💡 云策文档标注

概述

edit_post_link 是一个 WordPress 过滤器,用于修改文章编辑链接的锚标签。它允许开发者自定义链接的 HTML 输出。

关键要点

  • 过滤器名称:edit_post_link
  • 参数:$link(锚标签字符串)、$post_id(文章 ID)、$text(锚文本)
  • 用途:在 edit_post_link() 函数中应用,控制编辑链接的显示
  • 相关函数:edit_post_link() 用于显示文章编辑链接

📄 原文内容

Filters the post edit link anchor tag.

Parameters

$linkstring
Anchor tag for the edit link.
$post_idint
Post ID.
$textstring
Anchor text.

Source

echo $before . apply_filters( 'edit_post_link', $link, $post->ID, $text ) . $after;

Changelog

Version Description
2.3.0 Introduced.