Uma área de pesquisa sobre o WordPress para devs e autores do tema



get_comments_link ›

Desde1.5.0
Obsoleton/a
get_comments_link ( $post_id = 0 )
Parâmetros:
  • (int|WP_Post) $post_id Optional. Post ID or WP_Post object. Default is global $post.
    Required: No
    Padrão:
Retorna:
  • (string) The link to the comments.
Definido em:
Codex:

Retrieves the link to the current post comments.



Fonte

function get_comments_link( $post_id = 0 ) {
	$hash = get_comments_number( $post_id ) ? '#comments' : '#respond';
	$comments_link = get_permalink( $post_id ) . $hash;

	/**
	 * Filters the returned post comments permalink.
	 *
	 * @since 3.6.0
	 *
	 * @param string      $comments_link Post comments permalink with '#comments' appended.
	 * @param int|WP_Post $post_id       Post ID or WP_Post object.
	 */
	return apply_filters( 'get_comments_link', $comments_link, $post_id );
}