samedi 29 novembre 2014

wp_login_url not working correctly


I'm working on a project where I need to add a custom link to admin menu, and I'm using the following code for it:



$login_url = wp_login_url();
add_options_page('Login', 'Login Page', 'manage_options', 'loop.php?url='.esc_url($login_url).'');


Here's a thing. The above code is adding following URL to menu:


http://example.com/wp-admin/loop.php?url=http:/example.com/wp-login.php


Instead of:


http://example.com/wp-admin/loop.php?url=http://example.com/wp-login.php


What's different?


It's generating the URL with only http:/ instead of http://


I even tried it without esc_url but it's still not working.


Hope you can help :)





Aucun commentaire:

Enregistrer un commentaire