This is probably a PHP question, but since I encountered in on a wordpress documentation page, maybe I will get better answers here.
On https://developer.wordpress.org/reference/functions/wp_redirect/ it says
Note: wp_redirect() does not exit automatically, and should almost
always be followed by a call to exit;
I don’t quite understand what will really happen here if exit
is omitted here.
PHP’s doc says exit
is to "terminate the current script". So I assume if wp_redirect
is called in function.php
, the exit
following it would stop the rest part of function.php
from running, am I right? But why would I want that?