Last active
January 14, 2021 14:18
-
-
Save mgibbs189/b38a6688727d17b5222bb5a792c19733 to your computer and use it in GitHub Desktop.
User Post Type - display user links for upt_user post items
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add to your (child) theme's functions.php | |
add_filter( 'post_link', function( $url, $post ) { | |
if ( 'upt_user' == get_post_type( $post->ID ) ) { | |
$user_id = UPT()->get_user_id( $post->ID ); | |
$url = get_author_posts_url( $user_id ); | |
} | |
return $url; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment