Would it be better to ditch the JS formatter on the input fields in the admin and instead add the dollar sign and comma separation on the front end?
Yes, definitely.
This seems more logical, but then it raises another question of how to
prevent a user entering a dollar sign or comma formatting in the
admin.
Sanitize the input before storing it, using absint()
.
Related Posts:
- Can I query custom meta data through WP_Query
- Meta Query with AND & OR?
- Trying to perform complex custom field query with order by set to field value
- Compare meta_query decimals not working right
- Using OR in WP_Query negates the “NOT EXISTS” compare
- How can I combine meta_query queries?
- Difference between ‘LIKE’ and ‘IN’ in meta queries
- WP_Query display next custom post from today’s date
- Meta query with timestamp using WP_query
- Meta Query And/Or
- Query post by date (stored custom field meta as yyyymmdd) and differentiate across 12 months
- Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
- compare meta_query in get_posts arguments
- Filter WP_Query for posts having a certain meta-value
- Add custom fields to search
- SELECT max(meta_value) FROM wp_postmeta WHERE meta_key=’price’… stops working when value is over 999
- Matching Serialized Arrays with meta_query
- WP_Query orderby custom field then post_date in one query
- Getting attachments by meta value
- How do I search an array stored in a custom-field using WP_Query?
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- 2 orderby in wp_query with 2 custom fields
- How to get a meta value from all post
- WordPress Search Custom Meta Field Only
- WordPress altering my custom query, How to fix it?
- Query Problem – Show posts within category ‘x’ that have a custom field between ‘y’ and ‘z’
- Comparing timestamps in meta query doesn’t work
- Display two post types ordered by two custom fields
- Order by meta_key in custom post type doesn’t affect the query
- How can I query on the year part of a complete date in a custom field?
- meta_value_num sort glitch
- Order by value in serialized custom field
- Which is best in the following scenario : post_meta vs custom table vs parent/child posts
- Author Page Custom Query WHERE author OR [post meta value] OR [post meta value]
- Order Posts by meta value AND published date
- Sorting posts by custom fields in meta_query
- meta_query for a string inside a meta field containing a comma-separated list
- Upcoming Event: How do I sort database by custom date field, but ignore past dates?
- Complex WP_User_Query call fails on production server
- How do I use wp_query for WordPress search?
- Orderby custom field meta value ASC and then by date DESC
- Conditional custom field query
- Order query by meta_value with multiple custom fields
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- wp_query check if integer exists in custom field’s array
- WP 3.1 meta_query for multiple custom field values
- Fetch Record based on meta key dates
- Large AND OR query timing out
- Get posts with same meta value as current post
- meta_value_num not ordering all items
- Custom WP_Query for WordPress Search Results with meta_query
- Change order of posts
- How to combine custom fields to make one order-able value
- Meta query with multiple custom fields for archives page ordering problem
- filter custom field values $min $max
- Query based on custom fields start and end date
- Ordering posts by custom field named “date” in backend
- Get Data From wp_sitemeta for Multisite network
- Unique meta_key with array value vs repeated meta_key with single values
- Is it possible to retrieve all posts with a certain value for metadata?
- How can I do a variable for meta_query?
- comment meta_query for keys that aren’t yet set
- Select custom posts by meta_value and sort by a different meta value
- Getting a custom post’s custom field based on another custom post’s custom field select
- Display posts with specific value first in query
- change order of images attached to post
- add_query_arg to compare and display events from a certain date
- tax query between operator like
- How to query for posts with either one or another custom field
- Is it possible to compare the current time with a custom “start” and “end date
- How to update custom field of a posts in a particular category
- Query multiple post types, but different order for each
- Order by the first array within a meta_query
- Query ACF relationship field – Comparator IN – Value array
- multiple meta_query and orderby question
- ACF: How to query for a given value count of an array like field? (e.g.: How many rows has a `flexible_content` field?)
- get posts based on non-single metadata
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- Woocommerce products search with custom fields
- How to save multiple values with same meta_key, each value linked to another tag id
- How to improve my non-unique metadata MySQL entries?
- Comparing Meta Field date in WPQuery using Meta_Query?
- Query against multiple locations within single custom post type post
- WP_Query, ACF field and array
- Order by Date Custom Field
- Query multiple meta values at the same time :
- Create Shortcode shows only posts with custom_field meta
- meta_query ‘compare’ => ‘!=’ not working
- Using custom field as ‘orderby’ value causing post grouping by publish date
- Filter query based on date in custom field
- WP Query multiple select form – meta_query help
- WP_Query based on multiple metadata comparisons
- Checking if field is set before comparing with meta_query in query_posts?
- Display posts where date field matches current month?
- Querying meta values within an array
- How do delete a meta key?
- Filter Query Post by Custom Fields(by date)
- Query posts by Custom Meta (checkbox) & Genesis Grid Loop
- Get posts by meta value except one post [closed]
- WP Query Args – search by meta_key or title