WordPress.org

Ready to get started?Download WordPress

Forums

author.php and spaces in usernames (4 posts)

  1. circuit
    Member
    Posted 8 years ago #

    I am trying to code a static link into a forum profile which takes the user to the author.php for that profile. [The forum and WordPress share the same database].

    I understand that the link has to be in this format:

    http://www.domain.com/author/joe

    however if the user name has spaces in, i can't use that method.

    is it possible to pass the user ID nubmer to author.php instead?

  2. whooami
    Member
    Posted 8 years ago #

    however if the user name has spaces in, i can't use that method

    Of course you can, you just need to encode the space as %20

    you can either do that yourself when you make the links (blah) or write a simple function that uses str_replace to do it.

  3. circuit
    Member
    Posted 8 years ago #

    ok, i have that working OK but i still can't get the link to pull the right posts.

    for example: i am passing the author login to the link, but... this works:

    http://www.copsandrobbers.net/author/Summertime%20Dudes

    this does not:

    http://www.copsandrobbers.net/author/brudenell%20ents%20committee

    i think it would always work if i passed 'user_nicename'. but do i need to? have i missed something silly here?

  4. circuit
    Member
    Posted 8 years ago #

    bump...

Topic Closed

This topic has been closed to new replies.

About this Topic