Use comments_open() and pings_open(). Props coffee2code. fixes #9557
git-svn-id: http://svn.automattic.com/wordpress/trunk@10982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3804199e9b
commit
4754d22576
|
@ -916,7 +916,7 @@ function comments_popup_link( $zero = false, $one = false, $more = false, $css_c
|
||||||
|
|
||||||
$number = get_comments_number( $id );
|
$number = get_comments_number( $id );
|
||||||
|
|
||||||
if ( 0 == $number && 'closed' == $post->comment_status && 'closed' == $post->ping_status ) {
|
if ( 0 == $number && !comments_open() && !pings_open() ) {
|
||||||
echo '<span' . ((!empty($css_class)) ? ' class="' . $css_class . '"' : '') . '>' . $none . '</span>';
|
echo '<span' . ((!empty($css_class)) ? ' class="' . $css_class . '"' : '') . '>' . $none . '</span>';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -987,7 +987,7 @@ function get_comment_reply_link($args = array(), $comment = null, $post = null)
|
||||||
$comment = get_comment($comment);
|
$comment = get_comment($comment);
|
||||||
$post = get_post($post);
|
$post = get_post($post);
|
||||||
|
|
||||||
if ( 'open' != $post->comment_status )
|
if ( !comments_open($post->ID) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$link = '';
|
$link = '';
|
||||||
|
|
|
@ -519,8 +519,8 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine comment and ping settings.
|
// Determine comment and ping settings.
|
||||||
$allow_comments = ("open" == $page->comment_status) ? 1 : 0;
|
$allow_comments = comments_open($page->ID) ? 1 : 0;
|
||||||
$allow_pings = ("open" == $page->ping_status) ? 1 : 0;
|
$allow_pings = pings_open($page->ID) ? 1 : 0;
|
||||||
|
|
||||||
// Format page date.
|
// Format page date.
|
||||||
$page_date = mysql2date("Ymd\TH:i:s", $page->post_date);
|
$page_date = mysql2date("Ymd\TH:i:s", $page->post_date);
|
||||||
|
|
Loading…
Reference in New Issue