BP-TinyMCE fix loss of linebreaks in buddypress group description edit
-
This is an essential plugin for buddypress and I have spent a year trying to work out how to fix the loss of line formatting when editing groups
Having found it at last I though I’d be generous and share ??
The problem – The edit box reproduces the group description but the linebreaks and linespace are lost at each edit and have to be reinserted each time – what a pain!
BP TinyMCE Version 0.3.1
Buddypress Version 1.2.6
Custom Community 1.6.2
Wordpress Version 3.0.1The Fix
The plugin file bp-tinymce/bp-tinymce.php must have these Tags added
$allowedtags[‘p’] = array();
$allowedtags[‘br’] = array();
$allowedtags[‘br /’] = array();The buddypress file buddypress/bp-groups/bp-groups-filters.php
change
add_filter( ‘bp_get_group_description’, ‘wp_filter_kses’, 1 );
to
add_filter( ‘bp_get_group_description’, ‘bp_groups_filter_kses’, 1 );
and change
add_filter( ‘groups_group_description_before_save’, ‘wp_filter_kses’, 1 );
to
add_filter( ‘groups_group_description_before_save’, ‘bp_groups_filter_kses’, 1 );
make sure these tags are listed in the list below the filters
$groups_allowedtags[‘p’] = array();
$groups_allowedtags[‘p’][‘style’] = array();
$groups_allowedtags[‘br’] = array();
$groups_allowedtags[‘br /’] = array();Why this works – this ensures the linespace linebreak tags are available to BP-TinyMCE edit box the group description and the get group description and before save functions
It works for me and makes this plugin even more useful
And thanks to @boonebgorges for this essential plugin
- The topic ‘BP-TinyMCE fix loss of linebreaks in buddypress group description edit’ is closed to new replies.