bp_activity_maybe_load_mentions_scripts

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

Description

bp_activity_maybe_load_mentions_scripts(); 

Usage

  1. if ( !function_exists( 'bp_activity_maybe_load_mentions_scripts' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-activity/bp-activity-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_activity_maybe_load_mentions_scripts(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-activity/bp-activity-functions.php  
  1. function bp_activity_maybe_load_mentions_scripts() { 
  2. $mentions_enabled = bp_activity_do_mentions() && bp_is_user_active(); 
  3. $load_mentions = $mentions_enabled && ( bp_is_activity_component() || is_admin() ); 
  4.  
  5. /** 
  6. * Filters whether or not BuddyPress should load mentions scripts and assets. 
  7. * @since 2.1.0 
  8. * @param bool $load_mentions True to load mentions assets, false otherwise. 
  9. * @param bool $mentions_enabled True if mentions are enabled. 
  10. */ 
  11. return (bool) apply_filters( 'bp_activity_maybe_load_mentions_scripts', $load_mentions, $mentions_enabled );