WordPress at a glance

get_edit_comment_link() WP 1.0

Retrieves the edit comment link.

Возвращает

String/null. The edit comment link URL for the given comment.

Works based on: admin_url()
1 time = 0.0028741s = very slow | 50000 times = 6.57s = fast | PHP 7.3.12, WP 5.3.2
Hooks from the function

Usage

get_edit_comment_link( $comment_id );
$comment_id(int/WP_Comment)
Comment ID or WP_Comment object.
Default: 0

Список изменений

С версии 2.3.0 Введена.

Code of get_edit_comment_link() WP 5.5.1

wp-includes/link-template.php
<?php
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&amp;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 );
}

Related Functions

From category: Comments

No comments
    Log In . Register