Hi
I saw your helpful blog post on this topic: https://buddydev.com/enabling-buddypress-mention-auto-suggestions-on-any-page/
I was wondering how I would amend this to work on a page I have – it functions as a member dashboard so has tabs, one of which has an activity shortcode and update box. The code example you gave in the blog post has:
//modify this condition to suit yours
if( is_user_logged_in() && bp_is_current_component( ‘mediapress’ ) ) {
$load = true;– obviously I’m wanting this to work on a single page though so I guess the current_component bit needs to be different?
Grateful for any help you can offer!
Thanks
NicHi Nic,
You may try thisadd_filter( 'bp_activity_maybe_load_mentions_scripts', 'buddydev_enable_mention_autosuggestions', 10, 2 ); function buddydev_enable_mention_autosuggestions( $load, $mentions_enabled ) { if( ! $mentions_enabled ) { return $load;//activity mention is not enabled, so no need to bother } //modify this condition to suit yours if( is_user_logged_in() ) { $load = true; } return $load; }
That should do it on all pages.
Regards
Brajesh
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
This topic is: not resolved