Changeset 10542 for trunk/src/bp-activity/bp-activity-template.php
- Timestamp:
- 02/07/2016 04:29:52 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-activity/bp-activity-template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-template.php
r10516 r10542 3030 3030 $bp = buddypress(); 3031 3031 3032 // Assume activity can be commented on. 3033 $can_comment = true; 3034 3035 // Determine ability to comment based on activity action name. 3036 $activity_action = bp_get_activity_action_name(); 3037 3038 $turn_off = 0; 3039 if ( ! empty( $activities_template->disable_blogforum_replies ) ) { 3040 $turn_off = 1; 3041 } 3042 3043 $maybe_turn_off = array_fill_keys( array( 3044 'new_blog_post', 3045 'new_blog_comment', 3046 'new_forum_topic', 3047 'new_forum_post', 3048 ), $turn_off ); 3049 3050 $maybe_turn_off['activity_comment'] = 1; 3051 3052 // Fetch all the tracked post types once. 3053 if ( empty( $bp->activity->track ) ) { 3054 $bp->activity->track = bp_activity_get_post_types_tracking_args(); 3055 } 3056 3057 foreach ( $bp->activity->track as $action => $tracking_args ) { 3058 if ( empty( $tracking_args->activity_comment ) ) { 3059 $maybe_turn_off[ $action ] = $turn_off; 3060 } 3061 } 3062 3063 $can_comment = empty( $maybe_turn_off[ $activity_action ] ); 3032 // Determine ability to comment based on activity type name. 3033 $activity_type = bp_get_activity_type(); 3034 3035 // Get the 'comment-reply' support for the current activity type. 3036 $can_comment = bp_activity_type_supports( $activity_type, 'comment-reply' ); 3037 3038 // Neutralize activity_comment. 3039 if ( 'activity_comment' === $activity_type ) { 3040 $can_comment = false; 3041 } 3064 3042 3065 3043 /** … … 3067 3045 * 3068 3046 * @since 1.5.0 3047 * @since 2.5.0 Use $activity_type instead of $activity_name for the second parameter. 3069 3048 * 3070 3049 * @param bool $can_comment Status on if activity can be commented on. 3071 * @param string $activity_ action Current activity actionbeing checked on.3072 */ 3073 return apply_filters( 'bp_activity_can_comment', $can_comment, $activity_ action);3050 * @param string $activity_type Current activity type being checked on. 3051 */ 3052 return apply_filters( 'bp_activity_can_comment', $can_comment, $activity_type ); 3074 3053 } 3075 3054
Note: See TracChangeset
for help on using the changeset viewer.