WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Meta Box does not save url input correctly (2 posts)

  1. Mike_sa
    Member
    Posted 2 years ago #

    Hi

    I have added a metabox for a url input. The meta box displays on the correct custom post and does save the data input to the meta box.

    Unfortunately on saving the input data , it strips all // : and .
    I have looked for the use of trim and similar and have not found it.
    When I just add a test custom field and enter a url and save, it keeps the url as input. So it must be the coding of the meta box

    This is the metabox function I have written:

    [77 lines of code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    Could someone please help me to figure out what is causing the issue.

    Thanks very much

  2. Mike_sa
    Member
    Posted 2 years ago #

    I see the code was moderate but for others having a similar issue .

    In my code I was using sanatize_html_class........ I should have been using sanatize_url

Topic Closed

This topic has been closed to new replies.

About this Topic