bp_groups_maybe_load_mentions_scripts( bool $load_mentions, bool $mentions_enabled )

Should BuddyPress load the mentions scripts and related assets, including results to prime the mentions suggestions?

Description

Parameters

$load_mentions

(Required) True to load mentions assets, false otherwise.

$mentions_enabled

(Required) True if mentions are enabled.

Return

(bool) True if mentions scripts should be loaded.

Source

File: bp-groups/bp-groups-filters.php

function bp_groups_maybe_load_mentions_scripts( $load_mentions, $mentions_enabled ) {
	if ( ! $mentions_enabled ) {
		return $load_mentions;
	}

	if ( $load_mentions || bp_is_group_activity() ) {
		return true;
	}

	return $load_mentions;
}

Changelog

Changelog
Version Description
BuddyPress 2.2.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.