xxxxxxxxxx
add_action( 'init', function(){
add_permastruct( '%author_trip_vendor%', 'operator/%author%', [
'ep_mask' => EP_AUTHORS,
] );
} );
add_filter( 'author_link', function( $link, $author_id, $author_nicename ){
if ( user_can( $author_id, 'trip_vendor' ) ) {
$link = '/operator/' . $author_nicename;
$link = home_url( user_trailingslashit( $link ) );
}
return $link;
}, 10, 3 );