WordPress.org

Ready to get started?Download WordPress

Forums

Using esc_url (7 posts)

  1. sincewelastspoke
    Member
    Posted 3 years ago #

    Hi,

    I'd like to use the esc_url function in WP, but not have it remove spaces in the input.

    How do I achieve this?

    Michael

  2. Mark / t31os
    Moderator
    Posted 3 years ago #

    Spaces are not valid in URLs..

  3. sincewelastspoke
    Member
    Posted 3 years ago #

    Thanks for this.

    I'm actually hoping to use the URL field for different data.

    It would store the 'Location' of the user.
    Does it make sense to do this, or is it easier to add another field to the Comments box? Is this even possible?

    Thanks again

  4. Mark / t31os
    Moderator
    Posted 3 years ago #

    I'd suggest adding your own field...

    This blog is the best i could find for explaining the process.. (usage differs to how you'd want to use it, but it will give you the necessary info).
    http://www.soapboxdave.com/2010/02/using-wordpress-comment-meta/

  5. sincewelastspoke
    Member
    Posted 3 years ago #

    Awesome Mark!!! I will take a look into this. Many thanks.

  6. Mark / t31os
    Moderator
    Posted 3 years ago #

    I didn't really explain myself in the last response, so..
    ------------
    Rather then modifying an existing field, you add your own comment meta data, just like those that currently exist, name, email, url... etc..

    The blog above gives a very basic example of adding a field to the comments form and the procedure for displaying and saving that data.
    ------------
    @sincewelastspoke
    Happy i could help, and you don't necessarily need pay attention to the above, it's simply for clarity, incase other users stumble on this thread searching for similar information..

    Post back if you get stuck.. ;)

  7. sincewelastspoke
    Member
    Posted 3 years ago #

    Good call. It's a frustrating experience when the OP just adds 'It's ok, I got it working'....and then nothing :)

    Thanks for your assistance. Will let you know how it goes.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.