Unable to check for fatal errors – homepage redirect function
-
I have a function that redirects logged in users to a certain page when they try to visit the home page. This function works exactly as it should but in WordPress 4.9.x the code validation fails if there is any script to redirect users. If I remove the function then the error goes away and the file saves fine. The function is below:
function homepage_template_redirect() { if( is_front_page() && is_user_logged_in() ) { wp_redirect( get_permalink( get_page_by_title( 'My Tickets' ))); exit(); } } add_action( 'template_redirect', 'homepage_template_redirect' );
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Unable to check for fatal errors – homepage redirect function’ is closed to new replies.