Forums

[Plugin: TDO Mini Forms] Custom field with $ value removes formatting and a few numbers (9 posts)

  1. manilawp
    Member
    Posted 1 year ago #

    I created a custom field that needs a $ amount inputted but when I click on preview or submit, the $ sign along with the next two digits are removed. I have tried this with all versions of tdomf and all versions of wp. Could someone try this and see if they know what the problem is ?

  2. the_dead_one
    Member
    Posted 1 year ago #

    How odd. What I found was that the preview will remove the two digits after the $ sign but if I post, they are unmodified. What is also odd, it's across all input fields, post title, post content, custom field, etc. Will have a look into it.

  3. Ivovic
    Member
    Posted 1 year ago #

    Not that this is a solution necessarily, but I use custom fields for dollar values with TDOMF, and this would never have come up for me, because I don't put the currency symbol into the value.

    You can put the dollar sign in when you output the value in the custom field, it doesn't need to be in there all the time.

    The added benefit is that without a dollar sign in the actual value, you can do some math with it very easily if you want to.

  4. the_dead_one
    Member
    Posted 1 year ago #

    Solved it! It was to do with preg_replace. The dollar sign in the replacement text is actually expanded to the pattern match. So $22 would be expanded to the 22nd match, which doesn't exist, so the number would be expanded to blank.

    I've put in a fix and it'll be in the next version.

  5. manilawp
    Member
    Posted 1 year ago #

    thank you for the response.
    when is the next release ?
    is there any way i can fix this before the next release ?

  6. the_dead_one
    Member
    Posted 1 year ago #

    I have already released it: v0.11.1! You should be able to automatically upgrade your version using Wordpress (2.5)' plugin update feature too.

  7. manilawp
    Member
    Posted 1 year ago #

    thank you!!! that fixed it

  8. doog
    Member
    Posted 1 year ago #

    Is your plug-in site down? Unable to access.

  9. the_dead_one
    Member
    Posted 1 year ago #

    Yes it is. My host had a hardware failure. They are meant to be back up already. However the plugin is still availible from Wordpress.org's extend section.

Topic Closed

This topic has been closed to new replies.

About this Topic