Created
September 18, 2014 22:26
-
-
Save imath/5a3c4ac645ec765863f2 to your computer and use it in GitHub Desktop.
add BuddyPress auto suggest mention feature in bbPress.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** You could put this in the bp-custom.php file | |
* @see http://codex.buddypress.org/themes/bp-custom-php/ | |
*/ | |
function custom_bbpress_maybe_load_mentions_scripts( $retval = false ) { | |
if ( function_exists( 'bbpress' ) && is_bbpress() ) { | |
$retval = true; | |
} | |
return $retval; | |
} | |
add_filter( 'bp_activity_maybe_load_mentions_scripts', 'custom_bbpress_maybe_load_mentions_scripts' ); |
Super handy, thanks for this!
This hack works except that it does NOT work on group created forums. Any ideas on how to fix this?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Interestingly or not tried this on a local dev install and it worked as expected on bbp topic textarea, thought no more and uploaded to a staging site where it apparently failed to work, after checking all the obvious, script enqueueing correctly etc found the only difference was I had the bbp textarea toolbar buttons activated, and indeed activating those on the staging site kicked the @mentions into life.