bp_activity_can_comment
Determine if a comment can be made on an activity item.
Description
bp_activity_can_comment();
Usage
if ( !function_exists( 'bp_activity_can_comment' ) ) { require_once ABSPATH . PLUGINDIR . 'buddypress/bp-activity/bp-activity-template.php'; } // NOTICE! Understand what this does before running. $result = bp_activity_can_comment();
Defined (1)
The function is defined in the following location(s).
- /bp-activity/bp-activity-template.php
- function bp_activity_can_comment() {
- global $activities_template;
- $bp =buddypress);
- // Determine ability to comment based on activity type name.
- $activity_type = bp_get_activity_type();
- // Get the 'comment-reply' support for the current activity type.
- $can_comment = bp_activity_type_supports( $activity_type, 'comment-reply' );
- // Neutralize activity_comment.
- if ( 'activity_comment' === $activity_type ) {
- $can_comment = false;
- }
- /**
- * Filters whether a comment can be made on an activity item.
- *
- * @since 1.5.0
- * @since 2.5.0 Use $activity_type instead of $activity_name for the second parameter.
- *
- * @param bool $can_comment Status on if activity can be commented on.
- * @param string $activity_type Current activity type being checked on.
- */
- return apply_filters( 'bp_activity_can_comment', $can_comment, $activity_type );
- }