Replies
Hi Brajesh
HEY ! This code works Great ! You even put the error message on it.
It looks like fair amount of work. Thank you !I have some useful BP code that will replace the users profile name
with the username. Profile names can be duplicated.—If 100 users call
themselves ” John Doe ” a members search will find 100 John Doe.
/ Activity stream – which one made this post ?
This code will solve that.—– How do I post it on code snips page ? ? ?
Thank you
BPress-guyHi Brajesh
Here is some buddydev code I found on the web that is working on
buddypress profile editI’ve been trying to tweek it so it will work on group description edit
— with out any luck.Maybe you would know how do it easy ? That way you wouldn’t
have to write anything new.—————————————
function buddydev_limit_xpfield_length( $validated, $values, $field ) {
$allowed_len = 0;if ( $field instanceof BP_XProfile_Field_Type_Textarea ) {
$allowed_len = 600;
} elseif ( $field instanceof BP_XProfile_Field_Type_Textbox ) {
$allowed_len = 300;
}if ( $allowed_len ) {
$validated = strlen( $values ) < $allowed_len;
}return $validated;
}add_filter( ‘bp_xprofile_field_type_is_valid’, ‘buddydev_limit_xpfield_length’, 10, 3 );
—————————————
Thank you
BPress-guy
Hello Brajesh
Thank you for the response.For me first and second snippit limits display — but they -do- allow store
If a user types or pastes any number of characters they are all saved.
I pasted 100 thousand characters. After save, All of the text in the group
description edit box was still there.I looked at the wordpress buddypress backend ,- / Groups list edit.
All of the text was there It filled up 3 pages.Limit (truncate) description before saving would be awesome.
something that would stop an exceeded number of characters from
being typed or pasted beyond a set limit. Then, there is no way too
many characters could be saved.The group name edit is already doing that at 100 characters, I guess
there is a core file somewhere doing that.Thank you Brajesh
BPress-guy