wpseek.com
A WordPress-centric search engine for devs and theme authors
get_cancel_comment_reply_link › WordPress Function
Since2.7.0
Deprecatedn/a
› get_cancel_comment_reply_link ( $text = '', $post = null )
Parameters: (2) |
|
Returns: |
|
Defined at: |
|
Codex: | |
Change Log: |
|
Retrieves HTML content for cancel comment reply link.
Related Functions: cancel_comment_reply_link, get_comment_reply_link, comment_reply_link, _get_comment_reply_id, get_next_comments_link
Source
function get_cancel_comment_reply_link( $text = '', $post = null ) { if ( empty( $text ) ) { $text = __( 'Click here to cancel reply.' ); } $post = get_post( $post ); $reply_to_id = $post ? _get_comment_reply_id( $post->ID ) : 0; $style = 0 !== $reply_to_id ? '' : ' style="display:none;"'; $link = esc_html( remove_query_arg( array( 'replytocom', 'unapproved', 'moderation-hash' ) ) ) . '#respond'; $formatted_link = '<a rel="nofollow" id="cancel-comment-reply-link" href="' . $link . '"' . $style . '>' . $text . '</a>'; /** * Filters the cancel comment reply link HTML. * * @since 2.7.0 * * @param string $formatted_link The HTML-formatted cancel comment reply link. * @param string $link Cancel comment reply link URL. * @param string $text Cancel comment reply link text. */ return apply_filters( 'cancel_comment_reply_link', $formatted_link, $link, $text ); }