get_post_reply_link [ WordPress Function ]
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Retrieve HTML content for reply to post link.
The default arguments that can be override are 'add_below', 'respond_id', 'reply_text', 'login_text', and 'depth'. The 'login_text' argument will be used, if the user must log in or register first before posting a comment. The 'reply_text' will be used, if they can post a reply. The 'add_below' and 'respond_id' arguments are for the JavaScript moveAddCommentForm() function parameters.
Source
<?php
function get_post_reply_link($args = array(), $post = null) {
global $user_ID;
$defaults = array('add_below' => 'post', 'respond_id' => 'respond', 'reply_text' => __('Leave a Comment'),
'login_text' => __('Log in to leave a Comment'), 'before' => '', 'after' => '');
$args = wp_parse_args($args, $defaults);
extract($args, EXTR_SKIP);
$post = get_post($post);
if ( !comments_open($post->ID) )
return false;
if ( get_option('comment_registration') && !$user_ID ) {
$link = '<a rel="nofollow" href="' . wp_login_url( get_permalink() ) . '">' . $login_text . '</a>';
} else {
$link = "<a rel='nofollow' class='comment-reply-link' href='" . get_permalink($post->ID) . "#$respond_id' onclick='return addComment.moveForm(\"$add_below-$post->ID\", \"0\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>";
}
return apply_filters('post_comments_link', $before . $link . $after, $post);
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- get_post_reply_link | A HitchHackers guide through WordPress
Feb 12, 2011 ... function get_post_reply_link($args = array(), $post = null) { global $user_ID; $ defaults = array('add_below' => 'post', 'respond_id' => 'respond', ...
hitchhackerguide.com - post_reply_link (WordPress Function) - WPSeek.com
(int|object) $post Optional. Post that the comment is going to be displayed on. See: get_post_reply_link(). Returns: (string|bool|null) Link to show comment form, ...
wpseek.com - #16881 (Remove all unwanted 'nofollow' attributes from 'reply to ...
Additionally, the patch (see line 1110) fixes a minor inconsistency between the return values of get_comment_reply_link() and get_post_reply_link() when ...
core.trac.wordpress.org - Changing position of cancel_comment_reply_link and other ...
Jul 18, 2011 ... For instance, I'd like to wrap cancel_comment_reply_link in h4 tags and place it below get_post_reply_link . But I don't see any way to do it.
wordpress.stackexchange.com