Viewing 1 replies (of 1 total)
  • Plugin Author Brandon Allen

    (@thebrandonallen)

    Edit Author Slug does not do this, for the very simple fact that… it’s not simple. You can certainly do this, and here’s how:

    1. Intercept every request
    2. Check if a post or page exists, and verify that none of your plugins have created an endpoint that matches that request.
    3. If nothing in the previous step returns true, check to see if a user exists at that user_nicename.
    4. If the user exists, redirect, if not 404
    5. You can always do the user check first, but it’s much more likely that a request will be for a post/page than it will be for a user page. You don’t want to redirect to a user sam when/if there is a page sam, because which one is the user requesting?
    6. Also, keep in mind, that whenever you let the request fall through to the next step, whether it’s to go on to the requested page, or to the correct user URL, WP will do a lot of these same checks over again.
Viewing 1 replies (of 1 total)
  • The topic ‘will this plugin do this’ is closed to new replies.