Changeset 34038
- Timestamp:
- 09/11/2015 05:55:27 AM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/dashboard.php
r34006 r34038 557 557 $GLOBALS['comment'] =& $comment; 558 558 559 $comment_post_title = _draft_or_post_title( $comment->comment_post_ID ); 560 561 if ( current_user_can( 'edit_post', $comment->comment_post_ID ) ) { 559 if ( $comment->comment_post_ID > 0 && current_user_can( 'edit_post', $comment->comment_post_ID ) ) { 560 $comment_post_title = _draft_or_post_title( $comment->comment_post_ID ); 562 561 $comment_post_url = get_edit_post_link( $comment->comment_post_ID ); 563 562 $comment_post_link = "<a href='$comment_post_url'>$comment_post_title</a>"; 564 563 } else { 565 $comment_post_link = $comment_post_title;564 $comment_post_link = ''; 566 565 } 567 566 … … 600 599 601 600 if ( '1' === $comment->comment_approved ) { 602 $actions['view'] = '<a class="comment-link" href="' . esc_url( get_comment_link( ) ) . '">' . _x( 'View', 'verb' ) . '</a>';601 $actions['view'] = '<a class="comment-link" href="' . esc_url( get_comment_link( $comment ) ) . '">' . _x( 'View', 'verb' ) . '</a>'; 603 602 } 604 603 … … 631 630 ?> 632 631 633 <div id="comment-<?php echo $comment->comment_ID; ?>" <?php comment_class( array( 'comment-item', wp_get_comment_status( $comment->comment_ID) ) ); ?>>632 <div id="comment-<?php echo $comment->comment_ID; ?>" <?php comment_class( array( 'comment-item', wp_get_comment_status( $comment ) ) ); ?>> 634 633 635 634 <?php echo get_avatar( $comment, 50, 'mystery' ); ?> … … 639 638 <div class="dashboard-comment-wrap has-row-actions"> 640 639 <h4 class="comment-meta"> 641 <?php printf( /* translators: 1: comment author, 2: post link, 3: notification if the comment is pending */__( 'From %1$s on %2$s%3$s' ), 642 '<cite class="comment-author">' . get_comment_author_link() . '</cite>', $comment_post_link, ' <span class="approve">' . __( '[Pending]' ) . '</span>' ); ?> 640 <?php 641 if ( $comment_post_link ) { 642 printf( 643 /* translators: 1: comment author, 2: post link, 3: notification if the comment is pending */ 644 __( 'From %1$s on %2$s%3$s' ), 645 '<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>', 646 $comment_post_link, 647 ' <span class="approve">' . __( '[Pending]' ) . '</span>' 648 ); 649 } else { 650 printf( 651 /* translators: 1: comment author, 2: notification if the comment is pending */ 652 __( 'From %1$s %2$s' ), 653 '<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>', 654 ' <span class="approve">' . __( '[Pending]' ) . '</span>' 655 ); 656 } 657 ?> 643 658 </h4> 644 659 … … 660 675 <?php /* translators: %1$s is type of comment, %2$s is link to the post */ ?> 661 676 <h4 class="comment-meta"><?php printf( _x( '%1$s on %2$s', 'dashboard' ), "<strong>$type</strong>", $comment_post_link ); ?></h4> 662 <p class="comment-author"><?php comment_author_link( ); ?></p>677 <p class="comment-author"><?php comment_author_link( $comment ); ?></p> 663 678 664 679 <?php endif; // comment_type ?> 665 <blockquote><p><?php comment_excerpt( ); ?></p></blockquote>680 <blockquote><p><?php comment_excerpt( $comment ); ?></p></blockquote> 666 681 <p class="row-actions"><?php echo $actions_string; ?></p> 667 682 </div> 668 683 </div> 669 684 <?php 685 $GLOBALS['comment'] = null; 670 686 } 671 687 -
trunk/src/wp-includes/pluggable.php
r33891 r34038 1363 1363 1364 1364 $comment = get_comment( $comment_id ); 1365 if ( empty( $comment ) )1365 if ( empty( $comment ) || empty( $comment->comment_post_ID ) ) 1366 1366 return false; 1367 1367 … … 1822 1822 * @param WP_User $user The current user object. 1823 1823 * @param string $token The user's session token. 1824 */ 1824 */ 1825 1825 do_action( 'wp_verify_nonce_failed', $nonce, $action, $user, $token ); 1826 1826
Note: See TracChangeset
for help on using the changeset viewer.