get_edit_comment_link

函数
get_edit_comment_link ( $comment_id = 0 )
参数
  • (int|WP_Comment) $comment_id Optional. Comment ID or WP_Comment object.
    Required:
返回值
  • (string|void) The edit comment link URL for the given comment.
定义位置
相关方法
edit_comment_linkget_next_comments_linkget_comment_linkget_comments_linkget_edit_post_link
引入
2.3.0
弃用
-

get_edit_comment_link: 这个函数用来检索给定评论ID的编辑评论屏幕的URL。这可以用来生成链接或重定向到编辑评论屏幕。

读取编辑评论的链接。

function get_edit_comment_link( $comment_id = 0 ) {
	$comment = get_comment( $comment_id );

	if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) {
		return;
	}

	$location = admin_url( 'comment.php?action=editcomment&c=' ) . $comment->comment_ID;

	/**
	 * Filters the comment edit link.
	 *
	 * @since 2.3.0
	 *
	 * @param string $location The edit link.
	 */
	return apply_filters( 'get_edit_comment_link', $location );
}

常见问题

FAQs
查看更多 >
闪电侠

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

2025-12-05 17:32:57

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

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

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