Check if current page is wp-admin

I have created a common custom dashboard for my users located at “http://website.com/login/dashboard/” I’m trying to redirect users to that custom dashboard only if they are NOT admins & if the page IS http://www.website.com/login/wp-admin/ The redirection function I have is: add_action( ‘admin_init’, ‘redirect_so_15396771’ ); function redirect_so_15396771() { if ( defined( ‘DOING_AJAX’ ) && DOING_AJAX ) … Read more

wp_redirect() not working on form submission with init hook

I am trying to redirect the user after form submission using wp_redirect() but it it is not working. I am submitting data using init action hook. here is the code. function ab_process_application_form() { if (isset($_POST[‘new_application’]) && isset($_POST[‘ab_application_nonce’])) { if (wp_verify_nonce($_POST[‘ab_application_nonce’], ‘ab_application_form_nonce’)) { // all $_POST and validation code … // add record to database $insert_id … Read more

Controller functionality – if user is not logged in send them to specific page (not wp_login)

This sounds dead bang simple, but I just can’t figure it out. I want the following functionality: If user is not logged in and they try to access anywhere on the site (including the homepage) – send them to a specific page. I tried, adding the following but received a “not redirecting properly” message: if … Read more

How To Only Allow Users To View Their Own Buddypress Profiles? [closed]

Closed. This question is off-topic. It is not currently accepting answers. Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic. Closed 7 years ago. Improve this question I am currently … Read more

redirect pages with no content, instead of 404 error, using max_num_posts?

I have a site that has changed its pagination structure, resulting in a huge amount of 404 errors (more posts are being shown per page than previously, so there are lots of pages that were once indexed in search engines that are now 404’ing). What I want to do is create a function that will … Read more