Notifications
Clear all

[Solved] How to limit the number of characters/words in the signature text area?

4 Posts
2 Users
2 Reactions
1,479 Views
Posts: 108
Topic starter
(@hector)
Estimable Member
Joined: 6 years ago

Hello community.

I see that in the text area where users can place/edit their signature, they have no control over the number of characters / words that can be placed, the user can place as many characters/words as they want:

Which results in the user being able to place very long signatures:

How can we limit the number of characters/words in the signature area?

Thank you in advance for your help.

3 Replies
Tutrix
Posts: 1480
(@tutrix)
Noble Member
Joined: 5 years ago

@hector

I didn't find an option for it
only with the Addon "wpForo User Custom Fields"

but you can enter the desired value in the wpf-includes / functions-template.php at Line 1635.

$length = apply_filters('wpforo_signature_length', 0);
$signature = wpforo_text($signature, $length, false, false, false, false);
$signature = wpautop($signature);

replace "0" with the value limit (character)

But after a forum update you have to do this again
Even html codes for images or urls in the signature can be shortened and thus no longer displayed

 

 

1 Reply
Tutrix
(@tutrix)
Joined: 5 years ago

Noble Member
Posts: 1480

or use css to limit the content of the signature
everything that goes above the specified height is hidden

#wpforo #wpforo-wrap .wpfl-4 .wpforo-post .wpforo-post-signature {
overflow: hidden;
text-overflow: ellipsis;
max-height: 100px;
}
Posts: 108
Topic starter
(@hector)
Estimable Member
Joined: 6 years ago

Thank you very much for your help @Tutrix.