BLOG

See what we're whipping up!

// Add External Links Filter
function wpdev_permalink_links( $link, $post ) {
    $meta = get_post_meta( $post->ID, 'link_url', TRUE );
    $url = esc_url( filter_var( $meta, FILTER_VALIDATE_URL ) );
    return $url ? $url : $link;
}
add_filter( 'post_link', 'wpdev_permalink_links', 10, 2 );

No comments yet