BuddyPress Tip: How to Remove Visual Editor from Text Profile Fields

A little tip that I share with you and which is very useful on BuddyPress installations: it consists of removing the right of users of your social network to use the “rich text feature” (which includes italics, bold, etc.) in “multi-line” profile fields, such as the famous “about me” field.

Indeed, this will avoid having too fanciful profiles which could harm the visual identity of your “members” page for example, or the profile pages of your members.

To remove the Rich text editor from these profile fields, simply add this piece of code to your “bp-custom.php” file, or use a plugin like “My Custom Functions” if you prefer:

[coded]

/*—————-*/
/* REMOVE rich text on xprofile text area
/*—————-*/
function antipole_remove_rich_text($field_id = null) {
if ( ! $field_id ) {
$field_id = bp_get_the_profile_field_id('3');
}

$field = xprofile_get_field($field_id);

if ($field) {
$enabled = false;
}
}
add_filter( 'bp_xprofile_is_richtext_enabled_for_field', 'antipole_remove_rich_text' );

[/coded]

Don't miss business advice by email

No spam, just an email when new content is published.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

WordPress is the content management system of choice for online website builders. About 30% of the internet platforms currently available online are built around this system which has the share https://buff.ly/4gTcUuk

🫘 Flageolet beans, white beans, lentils, broad beans, chickpeas and other legumes are the best “slow carbohydrates” for health.
👉 Discover the superpowers of legumes in their dedicated content on Blooness: https://buff.ly/4b4nnlc

🍞 Sourdough bread with ancient flours is a more digestible alternative to traditional bread.
Natural fermentation can improve digestion and nutrient bioavailability.
👉 Learn more about the best breads at http://blooness.com

Load more

Don't miss business advice by email

No spam, just an email when new content is published.

en_USEN