Changeset 28431 for trunk/src/wp-includes/comment-template.php
- Timestamp:
- 05/15/2014 03:34:37 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-template.php
r28429 r28431 1292 1292 * @return mixed Link to show comment form, if successful. False, if comments are closed. 1293 1293 */ 1294 function get_comment_reply_link( $args = array(), $comment = null, $post = null) {1294 function get_comment_reply_link( $args = array(), $comment = null, $post = null ) { 1295 1295 1296 1296 $defaults = array( … … 1304 1304 ); 1305 1305 1306 $args = wp_parse_args( $args, $defaults);1307 1308 if ( 0 == $args['depth'] || $args['max_depth'] <= $args['depth'] ) 1306 $args = wp_parse_args( $args, $defaults ); 1307 1308 if ( 0 == $args['depth'] || $args['max_depth'] <= $args['depth'] ) { 1309 1309 return; 1310 1311 extract($args, EXTR_SKIP); 1312 1313 $comment = get_comment($comment); 1314 if ( empty($post) ) 1310 } 1311 1312 $add_below = $args['add_below']; 1313 $respond_id = $args['respond_id']; 1314 $reply_text = $args['reply_text']; 1315 1316 $comment = get_comment( $comment ); 1317 if ( empty( $post ) ) { 1315 1318 $post = $comment->comment_post_ID; 1316 $post = get_post($post); 1317 1318 if ( !comments_open($post->ID) ) 1319 } 1320 $post = get_post( $post ); 1321 1322 if ( ! comments_open( $post->ID ) ) { 1319 1323 return false; 1320 1321 if ( get_option('comment_registration') && ! is_user_logged_in() ) 1322 $link = '<a rel="nofollow" class="comment-reply-login" href="' . esc_url( wp_login_url( get_permalink() ) ) . '">' . $login_text . '</a>'; 1323 else 1324 } 1325 1326 if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) { 1327 $link = '<a rel="nofollow" class="comment-reply-login" href="' . esc_url( wp_login_url( get_permalink() ) ) . '">' . $args['login_text'] . '</a>'; 1328 } else { 1324 1329 $link = "<a class='comment-reply-link' href='" . esc_url( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>"; 1325 1330 } 1326 1331 /** 1327 1332 * Filter the comment reply link. … … 1334 1339 * @param WP_Post $post The WP_Post object. 1335 1340 */ 1336 return apply_filters( 'comment_reply_link', $ before . $link . $after, $args, $comment, $post );1341 return apply_filters( 'comment_reply_link', $args['before'] . $link . $args['after'], $args, $comment, $post ); 1337 1342 } 1338 1343
Note: See TracChangeset
for help on using the changeset viewer.