[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-groups/actions/ -> feed.php (source)

   1  <?php
   2  /**
   3   * Groups: RSS feed action
   4   *
   5   * @package BuddyPress
   6   * @subpackage GroupActions
   7   * @since 3.0.0
   8   */
   9  
  10  /**
  11   * Load the activity feed for the current group.
  12   *
  13   * @since 1.2.0
  14   *
  15   * @return false|null False on failure.
  16   */
  17  function groups_action_group_feed() {
  18  
  19      // Get current group.
  20      $group = groups_get_current_group();
  21  
  22      if ( ! bp_is_active( 'activity' ) || ! bp_is_groups_component() || ! $group || ! bp_is_current_action( 'feed' ) )
  23          return false;
  24  
  25      // If group isn't public or if logged-in user is not a member of the group, do
  26      // not output the group activity feed.
  27      if ( ! bp_group_is_visible( $group ) ) {
  28          return false;
  29      }
  30  
  31      // Set up the feed.
  32      buddypress()->activity->feed = new BP_Activity_Feed( array(
  33          'id'            => 'group',
  34  
  35          /* translators: Group activity RSS title - "[Site Name] | [Group Name] | Activity" */
  36          'title'         => sprintf( __( '%1$s | %2$s | Activity', 'buddypress' ), bp_get_site_name(), bp_get_current_group_name() ),
  37  
  38          'link'          => bp_get_group_permalink( $group ),
  39          'description'   => sprintf( __( "Activity feed for the group, %s.", 'buddypress' ), bp_get_current_group_name() ),
  40          'activity_args' => array(
  41              'object'           => buddypress()->groups->id,
  42              'primary_id'       => bp_get_current_group_id(),
  43              'display_comments' => 'threaded'
  44          )
  45      ) );
  46  }
  47  add_action( 'bp_actions', 'groups_action_group_feed' );


Generated: Wed Oct 23 01:01:50 2019 Cross-referenced by PHPXref 0.7.1