Title: [Plugin: Custom Post Type Permalinks] %author% still wrong plus feature request
Last modified: August 20, 2016

---

# [Plugin: Custom Post Type Permalinks] %author% still wrong plus feature request

 *  [jnz31](https://wordpress.org/support/users/jnz31/)
 * (@jnz31)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-custom-post-type-permalinks-author-still-wrong-plus-feature-request/)
 * hi
 * this really looks like a promising plugin, but it didnt work for me, cause it
   blew some other plugins that builded their own custom links (my shop stopped 
   working properly) so i guess it would be cool, to have the option to choose, 
   which post types should get a custom link.
 * plus i found an error. when using %author% your function is still wrong, cause
   it grabs the user name, not the user url
    you wrote
 *     ```
       $user = get_userdata($post->post_author);
       $newlink = str_replace("%author%", $user->user_login, $newlink);
       ```
   
 * try `$author->user_nicename`
 *     ```
       $user = get_userdata($post->post_author);
       $newlink = str_replace("%author%", $author->user_nicename, $newlink);
       ```
   
 * plus, but i dont know if this is solvable:
    when creating a new article and you
   enter the title, the url gets generated. but without the replaced %author%. you
   first have to save, to get the correclty rendered url. but this aint too important.
 * [http://wordpress.org/extend/plugins/custom-post-type-permalinks/](http://wordpress.org/extend/plugins/custom-post-type-permalinks/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [jnz31](https://wordpress.org/support/users/jnz31/)
 * (@jnz31)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-custom-post-type-permalinks-author-still-wrong-plus-feature-request/#post-2441647)
 * sorry, there was a mistake in my code
    this is the correct one:
 *     ```
       $user = get_userdata($post->post_author);
       $newlink = str_replace("%author%", $user->user_nicename, $newlink);
       ```
   
 *  Plugin Author [Toro_Unit (Hiroshi Urabe)](https://wordpress.org/support/users/toro_unit/)
 * (@toro_unit)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-custom-post-type-permalinks-author-still-wrong-plus-feature-request/#post-2441776)
 * Thanks jnz31!
 * I fixed the code in ver 0.7.3.
    Plase try latest Version.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Custom Post Type Permalinks] %author% still wrong plus feature
request’ is closed to new replies.

 * ![](https://ps.w.org/custom-post-type-permalinks/assets/icon-256x256.png?rev=
   3495884)
 * [Custom Post Type Permalinks](https://wordpress.org/plugins/custom-post-type-permalinks/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-post-type-permalinks/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-post-type-permalinks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-post-type-permalinks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-post-type-permalinks/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Toro_Unit (Hiroshi Urabe)](https://wordpress.org/support/users/toro_unit/)
 * Last activity: [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-custom-post-type-permalinks-author-still-wrong-plus-feature-request/#post-2441776)
 * Status: not resolved