bp_activity_mentions_script

Enqueue @mentions JS.

Description

bp_activity_mentions_script(); 

Usage

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

Defined (1)

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

/bp-activity/bp-activity-cssjs.php  
  1. function bp_activity_mentions_script() { 
  2. return; 
  3.  
  4. // Special handling for New/Edit screens in wp-admin. 
  5. if ( is_admin() ) { 
  6. if ( 
  7. ! get_current_screen() || 
  8. ! in_array( get_current_screen()->base, array( 'page', 'post' ) ) || 
  9. ! post_type_supports( get_current_screen()->post_type, 'editor' ) ) { 
  10. return; 
  11.  
  12.  
  13.  
  14. wp_enqueue_script( 'bp-mentions',buddypress)->plugin_url . "bp-activity/js/mentions{$min}.js", array( 'jquery', 'jquery-atwho' ), bp_get_version(), true ); 
  15. wp_enqueue_style( 'bp-mentions-css',buddypress)->plugin_url . "bp-activity/css/mentions{$min}.css", array(), bp_get_version() ); 
  16.  
  17. wp_style_add_data( 'bp-mentions-css', 'rtl', true ); 
  18. if ( $min ) { 
  19. wp_style_add_data( 'bp-mentions-css', 'suffix', $min ); 
  20.  
  21. // If the script has been enqueued, let's attach our mentions TinyMCE init callback. 
  22.  
  23. /** 
  24. * Fires at the end of the Activity Mentions script. 
  25. * This is the hook where BP components can add their own prefetched results 
  26. * friends to the page for quicker @mentions lookups. 
  27. * @since 2.1.0 
  28. */