bp_current_action(), 'show_hidden' => true, 'spam' => 'ham_only', ) ); // 404 if activity does not exist if ( empty( $activity['activities'][0] ) || bp_action_variables() ) { bp_do_404(); return; } else { $activity = $activity['activities'][0]; } // Default access is true. $has_access = true; // If activity is from a group, do an extra cap check. if ( isset( $bp->groups->id ) && $activity->component == $bp->groups->id ) { // Activity is from a group, but groups is currently disabled. if ( !bp_is_active( 'groups') ) { bp_do_404(); return; } // Check to see if the group is not public, if so, check the // user has access to see this activity. if ( $group = groups_get_group( $activity->item_id ) ) { // Group is not public. if ( 'public' != $group->status ) { // User is not a member of group. if ( !groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) { $has_access = false; } } } } // If activity author does not match displayed user, block access. if ( true === $has_access && bp_displayed_user_id() !== $activity->user_id ) { $has_access = false; } /** * Filters the access permission for a single activity view. * * @since 1.2.0 * * @param array $access Array holding the current $has_access value and current activity item instance. */ $has_access = apply_filters_ref_array( 'bp_activity_permalink_access', array( $has_access, &$activity ) ); /** * Fires before the loading of a single activity template file. * * @since 1.2.0 * * @param BP_Activity_Activity $activity Object representing the current activity item being displayed. * @param bool $has_access Whether or not the current user has access to view activity. */ do_action( 'bp_activity_screen_single_activity_permalink', $activity, $has_access ); // Access is specifically disallowed. if ( false === $has_access ) { // User feedback. bp_core_add_message( __( 'You do not have access to this activity.', 'buddypress' ), 'error' ); // Redirect based on logged in status. if ( is_user_logged_in() ) { $url = bp_loggedin_user_domain(); } else { $url = sprintf( site_url( 'wp-login.php?redirect_to=%s' ), urlencode( esc_url_raw( bp_activity_get_permalink( bp_current_action() ) ) ) ); } bp_core_redirect( $url ); } /** * Filters the template to load for a single activity screen. * * @since 1.0.0 * * @param string $template Path to the activity template to load. */ bp_core_load_template( apply_filters( 'bp_activity_template_profile_activity_permalink', 'members/single/activity/permalink' ) ); } add_action( 'bp_screens', 'bp_activity_screen_single_activity_permalink' ); /** * Add activity notifications settings to the notifications settings page. * * @since 1.2.0 * */ function bp_activity_screen_notification_settings() { if ( bp_activity_do_mentions() ) { if ( ! $mention = bp_get_user_meta( bp_displayed_user_id(), 'notification_activity_new_mention', true ) ) { $mention = 'yes'; } } if ( ! $reply = bp_get_user_meta( bp_displayed_user_id(), 'notification_activity_new_reply', true ) ) { $reply = 'yes'; } ?> tag for activity screen notification settings. * * @since 1.2.0 */ do_action( 'bp_activity_screen_notification_settings' ) ?>
 
  /> />
  /> />