mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-26 08:14:26 +00:00
Consult global comment in get_comment(). Don't show empty edit links.
git-svn-id: https://develop.svn.wordpress.org/trunk@5328 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -73,16 +73,20 @@ function get_approved_comments($post_id) {
|
||||
function &get_comment(&$comment, $output = OBJECT) {
|
||||
global $comment_cache, $wpdb;
|
||||
|
||||
if ( empty($comment) )
|
||||
return null;
|
||||
|
||||
if ( is_object($comment) ) {
|
||||
if ( empty($comment) ) {
|
||||
if ( isset($GLOBALS['comment']) )
|
||||
$_comment = & $GLOBALS['comment'];
|
||||
else
|
||||
$_comment = null;
|
||||
} elseif ( is_object($comment) ) {
|
||||
if ( !isset($comment_cache[$comment->comment_ID]) )
|
||||
$comment_cache[$comment->comment_ID] = &$comment;
|
||||
$_comment = & $comment_cache[$comment->comment_ID];
|
||||
} else {
|
||||
$comment = (int) $comment;
|
||||
if ( !isset($comment_cache[$comment]) ) {
|
||||
if ( isset($GLOBALS['comment']) && ($GLOBALS['comment']->id == $comment) ) {
|
||||
$_comment = & $GLOBALS['comment'];
|
||||
} elseif ( !isset($comment_cache[$comment]) ) {
|
||||
$_comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment' LIMIT 1");
|
||||
$comment_cache[$comment->comment_ID] = & $_comment;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user