I'd like to transform the result from %title in functions like next_post_link().
More specificaly, I created a function called short_title($title, $after, $length). The idea is to return the title with an $after when the title exceeds $length words. The function works like it's supposed to do.
However, I have a hard time invoking that function.
<?php previous_post_link( '%link', '<span>< ' . short_title( '%title', '...', 2) . '</span>' ); ?>
but that doesn't work and doesn't either when not using the ticks around %title.
Can you please explain me how to correctly invoke my function?