Support Forum

Can Signatures Have A Character Limit?

MS Matthew Selznick
Matthew Selznick
Member

Forgive me if I just can’t find this setting, but is it possible to limit signatures to a set number of characters? All I can see is the image setting for signatures.

Many thanks,

Matt

5 Answers

New Answer

MP Mr Papa
Mr Papa
Member

Not directly via option, but we do provide filters that allow you to filter the content and set such a limit.

If familiar with filters (they are standard to wp) let us know and we can show you.

On road until Wed so won’t be before then.

MS Matthew Selznick
Matthew Selznick
Member

Mr Papa said
If familiar with filters (they are standard to wp) let us know and we can show you.

That would be great. I’ll do some due diligence in the mean time, but I’m guessing I’ll need the help!

Thanks much.

MP Mr Papa
Mr Papa
Member

so the filter you want would be:

sph_display_signature_filter

so something like this in your spFunctions.php file of your theme (use your own, not ours):

add_filter(‘sph_display_signature_filter’, ‘my_sig_filter’);
function my_sig_filter($content) {
    // add your code to limit words or chars here
}

so its up to you how you might limit the character count.. lots of stuff on the net… or you could use the wp function for limiting the word count wp_trim_words() (http://codex.wordpress.org/Function_Reference/wp_trim_words)…  but lots of help on google for other various methods…

MS Matthew Selznick
Matthew Selznick
Member

Thanks! I’ll give it a gander.

Any thought to offering this feature in a future update?

Thanks again!