Changeset 9194 for trunk/src/bp-activity/bp-activity-template.php
- Timestamp:
- 11/27/2014 05:13:29 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-template.php
r9169 r9194 3316 3316 function bp_activity_can_comment() { 3317 3317 global $activities_template; 3318 $bp = buddypress(); 3318 3319 3319 3320 // Assume activity can be commented on … … 3322 3323 // Determine ability to comment based on activity action name 3323 3324 $activity_action = bp_get_activity_action_name(); 3324 switch ( $activity_action ) { 3325 3326 // Maybe turn off for blog and forum updates 3327 case 'new_blog_post' : 3328 case 'new_blog_comment' : 3329 case 'new_forum_topic' : 3330 case 'new_forum_post' : 3331 if ( ! empty( $activities_template->disable_blogforum_replies ) ) { 3332 $can_comment = false; 3333 } 3334 break; 3335 3336 // Turn off for activity comments 3337 case 'activity_comment' : 3338 $can_comment = false; 3339 break; 3340 } 3325 3326 $turn_off = 0; 3327 if ( ! empty( $activities_template->disable_blogforum_replies ) ) { 3328 $turn_off = 1; 3329 } 3330 3331 $maybe_turn_off = array_fill_keys( array( 3332 'new_blog_post', 3333 'new_blog_comment', 3334 'new_forum_topic', 3335 'new_forum_post', 3336 ), $turn_off ); 3337 3338 $maybe_turn_off['activity_comment'] = 1; 3339 3340 // Fetch all the tracked post types once. 3341 if ( empty( $bp->activity->track ) ) { 3342 $bp->activity->track = bp_activity_get_post_types_tracking_args(); 3343 } 3344 3345 foreach ( $bp->activity->track as $action => $tracking_args ) { 3346 if ( empty( $tracking_args->activity_comment ) ) { 3347 $maybe_turn_off[ $action ] = $turn_off; 3348 } 3349 } 3350 3351 $can_comment = empty( $maybe_turn_off[ $activity_action ] ); 3341 3352 3342 3353 /** … … 4368 4379 // Walk through the registered actions, and prepare an the 4369 4380 // select box options. 4370 foreach ( b uddypress()->activity->actionsas $actions ) {4381 foreach ( bp_activity_get_actions() as $actions ) { 4371 4382 foreach ( $actions as $action ) { 4372 4383 if ( ! in_array( $context, (array) $action['context'] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.