0
votes
1answer
48 views

redirect does not work in ajax function

I'm using ajax to post the form data. In the end I want to redirect to homepage. I'm trying following code, it does not work. It returns error 302. How can I redirect in the following function? ...
2
votes
1answer
82 views

Redirect users away from Admin breaks ajax

Tried to make a simple redirect for some users I don't want to access the wp-admin/, so I did this code: function no_admin_access() { if ( !current_user_can( 'delete_posts' ) ) { ...
2
votes
1answer
1k views

redirect out of wp-admin, without losing admin-ajax.php

I'm trying to keep all non-administrators out of the Wordpress admin panel by using a wp_redirect inside of an is_admin conditional. The problem is that a side effect of this if that non-admins can no ...