In `wp-includes/comment-template.php`, remove dead code:

* In `get_comment_reply_link()`, `$link` is set twice before it is used.
* In `Walker_Comment::start_lvl()`, `case 'ul':` is unreachable unless placed before `default:`. 
* In `Walker_Comment::end_lvl()`, `case 'ul':` is unreachable unless placed before `default:`.
* In `comment_form()`, `$id` is conditionally set and never used. 

See #27882.



git-svn-id: https://develop.svn.wordpress.org/trunk@28323 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-05-06 21:14:35 +00:00
parent 2b1c764ec7
commit 5530fe4c11
1 changed files with 2 additions and 6 deletions

View File

@ -1318,8 +1318,6 @@ function get_comment_reply_link($args = array(), $comment = null, $post = null)
if ( !comments_open($post->ID) )
return false;
$link = '';
if ( get_option('comment_registration') && ! is_user_logged_in() )
$link = '<a rel="nofollow" class="comment-reply-login" href="' . esc_url( wp_login_url( get_permalink() ) ) . '">' . $login_text . '</a>';
else
@ -1584,8 +1582,8 @@ class Walker_Comment extends Walker {
case 'ol':
$output .= '<ol class="children">' . "\n";
break;
default:
case 'ul':
default:
$output .= '<ul class="children">' . "\n";
break;
}
@ -1611,8 +1609,8 @@ class Walker_Comment extends Walker {
case 'ol':
$output .= "</ol><!-- .children -->\n";
break;
default:
case 'ul':
default:
$output .= "</ul><!-- .children -->\n";
break;
}
@ -2045,8 +2043,6 @@ function wp_list_comments( $args = array(), $comments = null ) {
function comment_form( $args = array(), $post_id = null ) {
if ( null === $post_id )
$post_id = get_the_ID();
else
$id = $post_id;
$commenter = wp_get_current_commenter();
$user = wp_get_current_user();