Changeset 10253 for trunk/src/bp-activity/bp-activity-screens.php
- Timestamp:
- 10/12/2015 05:45:14 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-screens.php
r10081 r10253 11 11 */ 12 12 13 // Exit if accessed directly 13 // Exit if accessed directly. 14 14 defined( 'ABSPATH' ) || exit; 15 15 … … 253 253 $bp = buddypress(); 254 254 255 // No displayed user or not viewing activity component 255 // No displayed user or not viewing activity component. 256 256 if ( !bp_is_activity_component() ) 257 257 return false; … … 260 260 return false; 261 261 262 // Get the activity details 262 // Get the activity details. 263 263 $activity = bp_activity_get_specific( array( 'activity_ids' => bp_current_action(), 'show_hidden' => true, 'spam' => 'ham_only', ) ); 264 264 … … 272 272 } 273 273 274 // Default access is true 274 // Default access is true. 275 275 $has_access = true; 276 276 277 // If activity is from a group, do an extra cap check 277 // If activity is from a group, do an extra cap check. 278 278 if ( isset( $bp->groups->id ) && $activity->component == $bp->groups->id ) { 279 279 280 // Activity is from a group, but groups is currently disabled 280 // Activity is from a group, but groups is currently disabled. 281 281 if ( !bp_is_active( 'groups') ) { 282 282 bp_do_404(); … … 285 285 286 286 // Check to see if the group is not public, if so, check the 287 // user has access to see this activity 287 // user has access to see this activity. 288 288 if ( $group = groups_get_group( array( 'group_id' => $activity->item_id ) ) ) { 289 289 290 // Group is not public 290 // Group is not public. 291 291 if ( 'public' != $group->status ) { 292 292 293 // User is not a member of group 293 // User is not a member of group. 294 294 if ( !groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) { 295 295 $has_access = false; … … 318 318 do_action( 'bp_activity_screen_single_activity_permalink', $activity, $has_access ); 319 319 320 // Access is specifically disallowed 320 // Access is specifically disallowed. 321 321 if ( false === $has_access ) { 322 322 323 // User feedback 323 // User feedback. 324 324 bp_core_add_message( __( 'You do not have access to this activity.', 'buddypress' ), 'error' ); 325 325 326 // Redirect based on logged in status 326 // Redirect based on logged in status. 327 327 if ( is_user_logged_in() ) { 328 328 $url = bp_loggedin_user_domain(); … … 442 442 public function is_activity() { 443 443 444 // Bail if not looking at a group 444 // Bail if not looking at a group. 445 445 if ( ! bp_is_activity_component() ) 446 446 return; 447 447 448 // Activity Directory 448 // Activity Directory. 449 449 if ( ! bp_displayed_user_id() && ! bp_current_action() ) { 450 450 bp_update_is_directory( true, 'activity' ); … … 457 457 add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) ); 458 458 459 // Single activity 459 // Single activity. 460 460 } elseif ( bp_is_single_activity() ) { 461 461 add_filter( 'bp_get_buddypress_template', array( $this, 'single_template_hierarchy' ) ); … … 475 475 * 476 476 * @param string $templates The templates from bp_get_theme_compat_templates(). 477 *478 477 * @return array $templates Array of custom templates to look for. 479 478 */ … … 492 491 493 492 // Merge new templates with existing stack 494 // @see bp_get_theme_compat_templates() 493 // @see bp_get_theme_compat_templates(). 495 494 $templates = array_merge( (array) $new_templates, $templates ); 496 495 … … 536 535 * 537 536 * @param string $templates The templates from bp_get_theme_compat_templates(). 538 *539 537 * @return array $templates Array of custom templates to look for. 540 538 */ … … 553 551 554 552 // Merge new templates with existing stack 555 // @see bp_get_theme_compat_templates() 553 // @see bp_get_theme_compat_templates(). 556 554 $templates = array_merge( (array) $new_templates, $templates ); 557 555
Note: See TracChangeset
for help on using the changeset viewer.