Changes the URLs pointing to pages and posts which have a "redirect" custom field, using that entry as the URL instead.
%site%in URLs are replaced by the WordPress home URL and site URLs, respectively.
redirect_by_custom_field_placeholdersto add or modify placeholders.
esc_urlwhich was messing up some redirects.
template_redirectaction instead, which catches some edge cases.