add_filter( 'post_type_link', 'wpse16427_post_type_link', 10, 4 );
function wpse16427_post_type_link( $post_link, $post, $leavename, $sample )
{
if(in_array($post->post_type, array('blog', 'news-article', 'action-funnel', 'bookmark','positon-camp')))
{
$authordata = get_userdata( $post->post_author );
$author = $authordata->user_nicename;
$post_link = str_replace( '%author%', $author, $post_link );
}
return $post_link;
}
Our Blog
Rewrite Custom Post Type (CPT) Permalinks
Recent Posts
How to add custom login and logout links in the wordpress navigation or menu programmatically ?
April 1, 2023
16 Comments
Read More »
How to create a Star Rating/Review/Feedback System with Toolset
August 9, 2021
No Comments
Read More »