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:
ryan 2009-04-17 07:02:55 +00:00
parent 3804199e9b
commit 4754d22576
2 changed files with 4 additions and 4 deletions

View File

@ -916,7 +916,7 @@ function comments_popup_link( $zero = false, $one = false, $more = false, $css_c
$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>';
return;
}
@ -987,7 +987,7 @@ function get_comment_reply_link($args = array(), $comment = null, $post = null)
$comment = get_comment($comment);
$post = get_post($post);
if ( 'open' != $post->comment_status )
if ( !comments_open($post->ID) )
return false;
$link = '';

View File

@ -519,8 +519,8 @@ class wp_xmlrpc_server extends IXR_Server {
}
// Determine comment and ping settings.
$allow_comments = ("open" == $page->comment_status) ? 1 : 0;
$allow_pings = ("open" == $page->ping_status) ? 1 : 0;
$allow_comments = comments_open($page->ID) ? 1 : 0;
$allow_pings = pings_open($page->ID) ? 1 : 0;
// Format page date.
$page_date = mysql2date("Ymd\TH:i:s", $page->post_date);