LPH
Well-known member
Is it possible to use a string replace in a XenForo template?
Consider the following postbit template change:
The link is going to a WordPress installation. Usernames with spaces are not allowed in WordPress authors, creating a 404 unless the space is replaced with a hyphen.
Is there a better way to replace the space with a hyphen in a template?
Consider the following postbit template change:
Code:
<a href="https://www.domain.com/wp/author/{$user.username}/">WordPress Author</a>
The link is going to a WordPress installation. Usernames with spaces are not allowed in WordPress authors, creating a 404 unless the space is replaced with a hyphen.
PHP:
str_replace(' ', '-', $authorUsername );
Is there a better way to replace the space with a hyphen in a template?