rmalviya
Forum Replies Created
-
Thanks for your explanatory reply.
As you’ve discovered yourself,
$_SERVER['REQUEST_URI']outputs/– which means at the time of when Force Login runs, it sees the root URL as what the user tried to visit.You’re right Kevin. After some debugging I found out that there was some other plugin which was redirecting the users to root when non-logged in users tried to access
wp-admin.I also found out that there is nothing needs to be done to bypass the
admin-post.phprequest while your plugin is active, which is great for plugin developers. I don’t need to put any bypassing or whitelisting logic for my request to work, it just works. Earlier it was not working because the another culprit plugin on site was redirecting the wp-admin request to home for non-logged in users and after that your plugin was trying to do its work i.e. asks for login via redirecting again.Thanks for your support. Keep doing good work.
Thanks for instant reply.
I’m using your suggested
v_forcelogin_bypass. The request is toadmin-post.phpand all the data is passed to it is through query parameters, so how can I check for any condition without getting any query parameters?
For checking bypassing condition I need either the current url or the query parameters to it. Please suggest solution for this.
Can you explain why it doesn’t get correct current url?Thanks for your reply.
Using
v_forcelogin_bypassdoesn’t make any difference either. The problem is that I’m getting wrong url for the request in the hooked function for bypassing. I only get root url part and all after that is stripped out. So, how can I check if the current url is the url which I want to bypass. The code I tried:function my_forcelogin_bypass( $bypass ) { error_log( $_SERVER['REQUEST_URI'] ); return $bypass; } add_filter( 'v_forcelogin_bypass', 'my_forcelogin_bypass' );When I make request to
admin-post.php, this outputs/in my debug.log file instead of expected path toadmin-post.php. Please help.The issue is still not resolved. The custom plugins can’t post to admin-post.php