Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
If the asker does not get an answer then they have 10 days to request a refund.
$20
Replace Register Link with Function
So this:
<a href="https://mysite.com/wp-login.php?action=register">needs to become this:
<a href="#myModal7" role="button" data-toggle="modal">I do not want to edit any core files, nor make copies of core files.
This question has been answered.
Kyle | 02/01/13 at 5:54pm
Edit
Tutorial: How to assign prize money
(25) Responses
See a threaded view of answers?
Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
-

Last edited:
02/01/13
6:00pmArnav Joy says:see this plugin
http://wordpress.org/extend/plugins/login-with-ajax/
http://wordpress.org/extend/plugins/modal-register/Previous versions of this answer: 02/01/13 at 6:00pm
-

Last edited:
02/01/13
5:59pmFrancisco Javier Carazo Gil says:Kyle,
I would make a new sign up form with jQuery UI you can show the modal dialog. -

Last edited:
02/01/13
6:04pmDbranes says:you could check out the filter 'register' to edit the register link
I think it could be something like this:
add_filter('register', 'my_register_link');
function my_register_link($link){
// do some stuff with register link
//
return $link;
}
-

Last edited:
02/01/13
6:08pmJohn Cotton says:Have you looked at the site_url filter?
apply_filters( 'site_url', $url, $path, $scheme, $blog_id );
You could check in a filter that it was the register link (ie strpos( $url, 'action=register' ) ) and then return your own link the circumstances you want to.
JC -

Last edited:
02/01/13
6:00pmKyle says:Hi arnav, thanks for the reply.
I do not want to change/replace any current functions. My security software does not work with third party plugins.
Needs to be a function -

Last edited:
02/01/13
6:00pm -

Last edited:
02/01/13
6:01pmFrancisco Javier Carazo Gil says:Prepare the sign up form directly in HTML into modal dialog with jQuery UI and prepare a script to make the signup:
$user_id = wp_create_user($name, $password, $email);
if(is_wp_error($user_id))
echo "Username already exists. Please try another one.";
else{
update_user_meta($user_id, 'address', $address);
update_user_meta($user_id, 'first_name', $first_name);
update_user_meta($user_id, 'last_name', $last_name);
}
$from = get_option('admin_email');
$headers = 'From: '.$from . "\r\n";
$subject = "Registration successful";
$msg = "Registration successful.\nYour login details\nUsername: $username";
wp_mail($email, $subject, $msg, $headers); -

Last edited:
02/01/13
6:02pmKyle says:Unfortunately this will remove the form from the scope of my security software which will cause malware and intrusion risks
-

Last edited:
02/01/13
6:04pmKyle says:I do not want to change any core functions or alter any existing processes. I only want to replace that link
-

Last edited:
02/01/13
6:06pmFrancisco Javier Carazo Gil says:Kyle,
No, you can use nonce to protect your forms, I don't know what software of security are you talking about.
You can use instead then .htaccess:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^action=register$ [NC]
RewriteRule ^wordpress/wp-login.php$ http://www.example.com/wordpress/register? [L,R=301,NC]
This will redirect http://www.example.com/wordpress/wp-login.php?action=register EXACTLY to http://www.example.com/wordpress/register -

Last edited:
02/01/13
6:07pmKyle says:Hi Dbranes, thanks for the reply. Something like this is exactly what I am looking for. I tried this but didn't get a result:
add_filter('register', 'my_register_link');
function my_register_link($link){
$link = '<a href="#myModal7" role="button" data-toggle="modal">Register</a>';
return $link;
}
Link is still directing to /wp-login?action=register -

Last edited:
02/01/13
6:09pmKyle says:My security has its own protective measures that I do not wish to circumvent, so I want to stay with the current process.
My server doesn't allow for editing htaccess -

Last edited:
02/01/13
6:09pmDbranes says:
ok, have you tried changing the priority:
add_filter('register', 'my_register_link',99);
-

Last edited:
02/01/13
6:12pmJohn Cotton says:add_filter('register', 'my_register_link');
That filter doesn't always have the registration link in it (checkout the core code to see why) so you should check it before returning.
Site url won't either so you would have to check there too, but it's the place where the actual url is being set so feels (to me at least) like the better place to check/change. -

Last edited:
02/01/13
6:12pmKyle says:Hi John, thanks for the reply
I need the extra part of the link with the data-toggle="modal" part to execute the modal I believe. I don't think that will execute with the $url hook -

Last edited:
02/01/13
6:13pm -

Last edited:
02/01/13
6:14pm -

Last edited:
02/01/13
6:25pmDbranes says:It looks like the register function wp_register() is not used everywhere.
In wp-login.php we have:
<a href="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login' ) ); ?>"><?php _e( 'Register' ); ?></a>
and
<form name="registerform" id="registerform" action="<?php echo esc_url( site_url('wp-login.php?action=register', 'login_post') ); ?>" method="post">
but not the function wp_register().
But in /wp-includes/default-widgets.php and in some theme's sidebars.php can we find
<?php wp_register(); ?>
-

Last edited:
02/01/13
6:28pmKyle says:Okay, yes, I was just looking through the codex too and wondered what it mean when it said included in sidebars. Is there someway to cover both bases?
-

Last edited:
02/01/13
6:40pmDbranes says:( if you use the Meta widget, then you get wp_register() )
... maybe some jQuery tricks to edit links with action=register ?
-

Last edited:
02/01/13
6:47pmKyle says:Hmm, yeah I am only concerned with the link on the login page unfortunately
I'm not too skilled with jQuery either. I wonder if there is a way to filter/replace the entire #nav paragraph? -

Last edited:
02/01/13
6:55pmKyle says:What about removing the #nav completely with jquery than inserting my link (and the lost password link) into the footer where the back to blog link is with the login_footer hook?
-

Last edited:
02/01/13
7:31pmDbranes says:ok, here is a toy example (without jQuery) to replace the #nav html code on the wp-login.php page
add_action('login_footer','my_login_footer');
function my_login_footer(){
echo "<script>
var e = document.getElementById('nav');
var myhtml = '<a href=\"#myModal7\" role=\"button\" data-toggle=\"modal\">Register (modified)</a> | <a href=\"http://example.com/wp-login.php?action=lostpassword\" title=\"Password Lost and Found\">Lost your password?</a>';
e.innerHTML= myhtml;
</script>";
}
-

Last edited:
02/01/13
7:37pmKyle says:Okay making progress :)
Very odd result, so when viewing the page markup it looks exactly as it should:
<a href="#myModal7" role="button" data-toggle="modal">
However, the actual link is this:
/wp-login.php?redirect_to=https%3A%2F%mysite.com%2F#myModal7
Strange -

Last edited:
02/01/13
8:01pm
This question has expired.
John Cotton, Francisco Javier Carazo Gil, Arnav Joy, Kyle, Naveen Chand voted on this question.
Current status of this question: Completed
Please log in to add additional discourse to this page.
Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
If the asker does not get an answer then they have 10 days to request a refund.
