Custom Post Type Permalinks
%author% still wrong plus feature request (3 posts)

  1. jnz31
    Posted 4 years ago #


    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.


  2. jnz31
    Posted 4 years ago #

    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);
  3. Toro_Unit (Hiroshi Urabe)
    Plugin Author

    Posted 4 years ago #

    Thanks jnz31!

    I fixed the code in ver 0.7.3.
    Plase try latest Version.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Post Type Permalinks
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic