1

I have a question that I hope will be pretty simple for some of the WordPress Gurus out there.

I have a WordPress network and whenever a users signs up, I would like to show (on signup confirmation page) a message that shows the code:

<script type="text/javascript" src="http://mysite.com/js/redirection-mobile.js"></script>

<script type="text/javascript">

SA.redirection_mobile ({nmobile_url :
"USERURL.mysite.com", });

</script>

Note that I am trying to display the user's URL that they just signed up with in the message.

Does anybody know how to do that without modifying any of the WordPress core?

Let me know if this is a little too vague, or if you need any more information.

Thanks, Keenan

2

http://codex.wordpress.org/Plugin_API/Action_Reference/user_register

This action hook allows you to access data for a new user immediately after they are added to the database. The user id is passed to hook as an argument.

add_action('user_register', 'registration_redirect');

function registration_redirect($user_id) {
$url = 'PAGE_WHERE_YOUR_CODE_IS_DISPLAYED';
wp_redirect( $url );
exit; 
}

placing that in your functions.php should work. This attempts to redirect the user after they register, i believe after they click the link in the email, which is what i think you were looking for.

| improve this answer | |
  • Thanks for the link! Unfortunately, I am just looking to actually display the Javascript code above (not run it), so people who are signing up can copy and paste it into their own sites. So I need a way to display that on the signup confirmation of a WordPress network site. – Keenan Payne Jul 19 '13 at 19:00
  • ohhhhhh. Well you can just put that javascript inside code tags on a page, and then redirect them to that page using the code i supplied above. – Vigs Jul 19 '13 at 19:06
  • Awsome! Im happy it worked :D – Vigs Jul 19 '13 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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