bp_add_mentions_on_tinymce_init( array $settings, string $editor_id )

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

Description

Parameters

$settings

(Required) An array with TinyMCE config.

$editor_id

(Required) Unique editor identifier, e.g. 'content'.

Return

(array) $mceInit An array with TinyMCE config.

Source

File: bp-activity/bp-activity-cssjs.php

function bp_add_mentions_on_tinymce_init( $settings, $editor_id ) {
	// We only apply the mentions init to the visual post editor in the WP dashboard.
	if ( 'content' === $editor_id ) {
		$settings['init_instance_callback'] = 'window.bp.mentions.tinyMCEinit';
	}

	return $settings;
}

Changelog

Changelog
Version Description
BuddyPress 2.3.3 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.