bp_add_mentions_on_tinymce_init

Bind the mentions listener to a wp_editor instance when TinyMCE initializes.

Description

(array) bp_add_mentions_on_tinymce_init( (array) $settings, (string) $editor_id ); 

Returns (array)

$mceInit An array with TinyMCE config.

Parameters (2)

0. $settings (array)
An array with TinyMCE config.
1. $editor_id (string)
Unique editor identifier, e.g. content..

Usage

  1. if ( !function_exists( 'bp_add_mentions_on_tinymce_init' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-activity/bp-activity-cssjs.php'; 
  3.  
  4. // An array with TinyMCE config. 
  5. $settings = array(); 
  6.  
  7. // Unique editor identifier, e.g. 'content'. 
  8. $editor_id = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bp_add_mentions_on_tinymce_init($settings, $editor_id); 
  12.  

Defined (1)

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

/bp-activity/bp-activity-cssjs.php  
  1. function bp_add_mentions_on_tinymce_init( $settings, $editor_id ) { 
  2. // We only apply the mentions init to the visual post editor in the WP dashboard. 
  3. if ( 'content' === $editor_id ) { 
  4. $settings['init_instance_callback'] = 'window.bp.mentions.tinyMCEinit'; 
  5.  
  6. return $settings;