Vendor Name in Permalinks

I use dokan in Wordpress. And I want to put the name of the seller in my permalinks. If I do it in the form of /p/%author%, the products of two different stores with the same product overlap and numbers like -2,-3 come at the end. function wpse_post_type_link( $permalink, $post ) { if ( 'product' === $post->post_type && false !== strpos( $permalink, '%author%' ) ) { $author = get_the_author_meta( 'user_nicename', $post->post_author ); $permalink = str_replace( '%author%', $author, $permalink ); } else { $permalink = str_replace('%author%', 'p', $permalink); } return $permalink; } add_filter( 'post_type_link', 'wpse_post_type_link', 20, 2 );```

Comment (0)

You’ll be in good company