bp_comments_open( bool $open, int $post_id )

Force comments_status to ‘closed’ for BuddyPress post types.


Description Description


Parameters Parameters

$open

(Required) True if open, false if closed.

$post_id

(Required) ID of the post to check.


Top ↑

Return Return

(bool) True if open, false if closed.


Top ↑

Source Source

File: bp-core/bp-core-theme-compatibility.php

function bp_comments_open( $open, $post_id = 0 ) {

	$retval = is_buddypress() ? false : $open;

	/**
	 * Filters whether or not to force comments_status to closed for BuddyPress post types.
	 *
	 * @since 1.7.0
	 *
	 * @param bool $retval  Whether or not we are on a BuddyPress post type.
	 * @param bool $open    True if comments open, false if closed.
	 * @param int  $post_id Post ID for the checked post.
	 */
	return apply_filters( 'bp_force_comment_status', $retval, $open, $post_id );
}

Top ↑

Changelog Changelog

Changelog
Version Description
1.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.