mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Add filters to comments_open() and pings_open(). Props tellyworth. fixes #5761
git-svn-id: https://develop.svn.wordpress.org/trunk@6716 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -562,14 +562,15 @@ function trackback_rdf($deprecated = '') {
|
||||
* @since 1.5
|
||||
* @uses $post
|
||||
*
|
||||
* @param int $post_id An optional post ID to check instead of the current post.
|
||||
* @return bool True if the comments are open
|
||||
*/
|
||||
function comments_open() {
|
||||
global $post;
|
||||
if ( 'open' == $post->comment_status )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
function comments_open( $post_id=NULL ) {
|
||||
|
||||
$_post = get_post($post_id);
|
||||
|
||||
$open = ( 'open' == $_post->comment_status );
|
||||
return apply_filters( 'comments_open', $open, $post_id );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -578,14 +579,15 @@ function comments_open() {
|
||||
* @since 1.5
|
||||
* @uses $post
|
||||
*
|
||||
* @param int $post_id An optional post ID to check instead of the current post.
|
||||
* @return bool True if pings are accepted
|
||||
*/
|
||||
function pings_open() {
|
||||
global $post;
|
||||
if ( 'open' == $post->ping_status )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
function pings_open( $post_id=NULL ) {
|
||||
|
||||
$_post = get_post($post_id);
|
||||
|
||||
$open = ( 'open' == $post->ping_status );
|
||||
return apply_filters( 'pings_open', $open, $post_id );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user