bp_maybe_load_mentions_scripts_for_blog_content( 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

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

$mentions_enabled

(bool) (Required) True if mentions are enabled.

Return

(bool) True if mentions scripts should be loaded.

Source

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

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

	if ( $load_mentions || ( bp_is_blog_page() && is_singular() && comments_open() ) ) {
		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.