In asking a question about hooks and redirects, I was advised to use wp_redirect in place of the PHP header function. Just wondering why wp_redirect is preferable?
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
See the source. It has some additional logic for IIS servers, as well as some hooks. It is also pluggable function, so it might be redefined. Overall it's just more flexible and gives other developers more options to work with your code, unavailable if you just hardcode things. |
|||||||||||
|
|
It (wp_redirect fn) is more than just setting the header. Just take a look here what it does before setting a header. |
|||
|
|