0

I have this PHP code:

$message = sprintf(__(( "Activate your account here link:\n\n%s\n\n to verify that you're not some freaky robot. \n\n" ),
        $user, $user_email, $key, $meta),site_url( "?page=gf_activation&key=$key" ));

I want to put a link where it says 'some freaky robot' to an external URL. Is there anyway to do so? wrapping it in doesn't work because of the quotation mark.

2 Answers 2

0

Just wrap it in a link:

..."not <a href=\"someurl\">some freaky robot.</a> \n\n"...
1
  • Yup, that's about it. Remember to use single quotes, or else concatenate. Jul 22, 2014 at 16:27
0

I'm guessing the __() function is a translator, right? In which case you'll probably not want the URL hard coded in there.

This format should do the trick, it's how I approach the same problem in my own apps. I've simplified it a bit from your use-case for the sake of example, just adapt it as necessary to include your other variables:

$message = sprintf(__('Activate your account to verify that you\'re not <a href="%s">some freaky robot</a>'), $verifyUrl);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.