Redirect Pending Review Status Preview page url to custom url
function mmk_pending_review_redirect(){ $user = wp_get_current_user(); if(get_post_status ( get_the_id() ) != ‘publish’) if (is_user_logged_in() && !in_array( ‘administrator’, (array) $user->roles ) && !is_author() ) { wp_redirect( “https://example.com/under-approval”); exit; }else{ wp_redirect( “https://example.com/under-approval”) ); exit; } } } add_action(‘template_redirect’, ‘mmk_pending_review_redirect’); explanation: redirect non-admin users to custom URL if they are not author of the current post where status is … Read more