0 ? get_permalink($parent_id) : home_url('/'); wp_safe_redirect($redirect_url, 301); exit;