Links converting to plain text I've got a function that should generate a link as such &lt;a href="http://linklocation"&gt;Set Password&lt;/a&gt;, which does happen, but it is generating as plain text.

My guess is that this is due to my use of the t() and l() functions in the manner I'm using them.

Here's my code:

  global $user;
  $account = new stdClass();
  $account-&gt;uid = $user-&gt;uid;
  $account-&gt;login = $user-&gt;login;
  $account-&gt;pass = $user-&gt;pass;
  $link = l('Set Password', user_pass_reset_url($account));
  $token = t(token_replace(variable_get('listing_edit_free_activated_page', 'Your free content has been activated. Thanks! @link')), array('@link' =&gt; $link));


As you can tell, I'm attempting to generate a one-time user login link with the text, "Set Password". The token_replace() isn't really relevant to this problem.

Am I completely without options here? I want to use both t() and l() here - there's not really an easy way to not use both that I can see.

How do I use both while still maintaining the structure of $link as a link?
The t function's first argument is a string, and the second is a keyed array of arguments (search => replace).

The string your passing in is:

token_replace(variable_get('listing_edit_free_activated_page', 'Your free content has been activated. Thanks!'))


And the replacement your searching for it @link.

As the string @link does not appear in the string your passing in no replacements are made.

Here is an example where a replacement will be made:

$text = t("@name's blog", array('@name' =&gt; format_username($account)));