The login_url filter not working in WP 4.4?
-
I have created a plug-in that allows users to change the login URL from domain.com/wp-login.php to domain.com/login-page/ . I upgraded from 4.3.1 to 4.4 and now users can’t login using their custom URL. Can someone point me in the direction to fix this?
I use the
login_url
filter to change the login URL. I need to disable to plug-in so that at least, for now, users can login using wp-login.php. (I know – shame on me for not testing my plug-in before upgrading WordPress. Lesson learned…)I’ve taken a look at core.trac to compare the core source code changes from 4.3.1 to 4.4, and I believe that WordPress ignores the
login_url
filter now. (Click on the link I provieed, and if you look at the bottom of the page, you’ll see what I mean.)Is this a bug in WordPress? Or, do I now need to use a new filter? Can someone point me in the right direction as to where I need to start debugging?
Here is a bit of my plug-in’s code, which I believe is where the problem lies.
add_filter('login_url', 'jbdCustom_login_inurl', 10, 2 ); // the CONST_JBD constants are defined elsewhere in my code function jbdCustom_login_inurl($force_reauth, $redirect){ $login_url = CONST_JBD_LOGIN_PAGE; $login_url = add_query_arg( 'redirect_to', urlencode( CONST_JBD_LOGIN_LAND ), $login_url ); if ( $force_reauth ) $login_url = add_query_arg( 'reauth', '1', $login_url ) ; return $login_url; } add_filter('logout_url', 'jbdCustom_login_outurl', 10, 2); function jbdCustom_login_outurl($logouturl, $redir){ $redir = CONST_JBD_LOGIN_PAGE.'?gone=out'; return $logouturl . '&redirect_to=' . urlencode($redir); }
- The topic ‘The login_url filter not working in WP 4.4?’ is closed to new replies.