That function should work equally well if included in a plugin. template_redirect
is an action that fires any time WP parses a URL, it’s not exclusive to themes.
That function should work equally well if included in a plugin. template_redirect
is an action that fires any time WP parses a URL, it’s not exclusive to themes.