Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Last active January 14, 2021 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgibbs189/b38a6688727d17b5222bb5a792c19733 to your computer and use it in GitHub Desktop.
Save mgibbs189/b38a6688727d17b5222bb5a792c19733 to your computer and use it in GitHub Desktop.
User Post Type - display user links for upt_user post items
<?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