Forums

role specific permalink structure (4 posts)

  1. zyrq
    Member
    Posted 3 years ago #

    Does anyone know if it is possible to have a role specific permalink structure.
    role=editor ->example.com/editors/johndoe
    role=author ->example.com/authors/janedoe

    Changing the var $author_base = 'author' in rewrite.php only allows for 1 instance. Where/how to test for the role?

    Any ideas?Different options? Thanks

  2. zyrq
    Member
    Posted 3 years ago #

    bumpy

  3. zyrq
    Member
    Posted 3 years ago #

    Well, I guess I've read about everything about this in the forums for the last couple of hours.
    The closest I got is the reply by jeremyboggs on this thread:
    http://wordpress.org/support/topic/144217?replies=13
    The solution by jeremyboggs works perfectly to change the author_base to a single term in a custom function.
    If I only could retrieve the role of the user/author

    role=editor ->author_base = 'editor'
    role=author ->author_base = 'author'
    role=member ->author_base = 'member'
    etc.

    I have tried numerous possiblities but havent come up with a solution.
    Anybody? Thanks.

  4. zyrq
    Member
    Posted 3 years ago #

    OK, interesting conversation...

    I have this working:
    role=editor ->builds this URL: example.com/editors/johndoe
    role=author ->builds this URL: example.com/authors/janedoe

    In functions.php I added
    $wp_rewrite->author_base = 'editors';
    work great for the editors;

    Now I only need to have an extra rewrite rule (do I?) that rewrites
    'authors' to the same as 'editors', its just an aka of author.
    How? which Action? which Filter? 2 extra rewrite rules? Have some coffee? Or something stronger?

Topic Closed

This topic has been closed to new replies.

About this Topic