July 29, 2020
I use Page Links To a lot. Probably on every website I’ve built for the last five years.
Recently, I ran into an issue where a conflict was preventing the URLs from saving using Page Link To, and I needed to come up with an alternate solution.
I stumbled across this function, that can setup an entire Post Type to redirect to a custom field value, and I think that’s what I’m looking for.
Here’s a modification that can be placed anywhere and grab custom field info (using ACF). I ended up with a Page Links To similar function, without having to use an additional plugin.
$url = get_field('resource_url');
if( $url ) {
wp_redirect( $url );
die;
}