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 ?
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.
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.
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.
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 ?
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.
manilawp
Member
Posted 1 year ago #
thank you!!! that fixed it
Is your plug-in site down? Unable to access.
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.