Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/24/2014 08:09:13 PM (11 years ago)
Author:
djpaul
Message:

Groups, Suggestions: add support for @mentions UI in Group Activity screens.

This is achieved by adding support for a new data-suggestions-group-id property to the relevant textarea/input element.
See also r9242:9245 for incremental changes that support this new functionality.

Fixes #5934. Props m@rk, imath, DJPaul.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-filters.php

    r9026 r9276  
    234234}
    235235add_filter( 'get_latest_topics_fields', 'groups_filter_forums_root_page_sql' );
     236
     237/**
     238 * Should BuddyPress load the mentions scripts and related assets, including results to prime the
     239 * mentions suggestions?
     240 *
     241 * @param bool $load_mentions True to load mentions assets, false otherwise.
     242 * @param bool $mentions_enabled True if mentions are enabled.
     243 * @return bool True if mentions scripts should be loaded.
     244 * @since BuddyPress (2.2.0)
     245 */
     246function bp_groups_maybe_load_mentions_scripts( $load_mentions, $mentions_enabled ) {
     247    if ( ! $mentions_enabled ) {
     248        return $load_mentions;
     249    }
     250
     251    if ( $load_mentions || ( bp_is_group_activity() || bp_is_group_home() ) ) {
     252        return true;
     253    }
     254
     255    return $load_mentions;
     256}
     257add_filter( 'bp_activity_maybe_load_mentions_scripts', 'bp_groups_maybe_load_mentions_scripts', 10, 2 );
Note: See TracChangeset for help on using the changeset viewer.