Changeset 10054 for trunk/src/bp-activity/bp-activity-cssjs.php
- Timestamp:
- 08/18/2015 10:54:46 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-cssjs.php
r9819 r10054 42 42 } 43 43 44 // If the script has been enqueued, let's attach our mentions TinyMCE init callback. 45 add_filter( 'tiny_mce_before_init', 'bp_add_mentions_on_tinymce_init', 10, 2 ); 46 44 47 /** 45 48 * Fires at the end of the Activity Mentions script. … … 54 57 add_action( 'bp_enqueue_scripts', 'bp_activity_mentions_script' ); 55 58 add_action( 'bp_admin_enqueue_scripts', 'bp_activity_mentions_script' ); 59 60 /** 61 * Bind the mentions listener to a wp_editor instance when TinyMCE initializes. 62 * 63 * @since BuddyPress (2.3.3) 64 * 65 * @param array $settings An array with TinyMCE config. 66 * @param string $editor_id Unique editor identifier, e.g. 'content'. 67 * 68 * @return array $mceInit An array with TinyMCE config. 69 */ 70 function bp_add_mentions_on_tinymce_init( $settings, $editor_id ) { 71 // We only apply the mentions init to the visual post editor in the WP dashboard. 72 if ( 'content' === $editor_id ) { 73 $settings['init_instance_callback'] = 'window.bp.mentions.tinyMCEinit'; 74 } 75 76 return $settings; 77 }
Note: See TracChangeset
for help on using the changeset viewer.