Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

money field now accepts $before argument - fixed #55 #196

Closed
wants to merge 1 commit into from

3 participants

@jancbeck

Needed the money field for a Euro-based project. This fix worked for me.

Falls back to $ if argument not supplied.

@sxalexander

+1 for this update.

@novrian

+1 on this pull request!

I think it would be sensible if you changed the before argument to currency, currency_format, or shorter currency_fmt.

Thanks

@jtsternberg jtsternberg closed this pull request from a commit
@jtsternberg jtsternberg ### 0.9.4
* Added field "before" and "after" options for each field. Solves issue with '$' not being the desired text_money monetary symbol, props @GaryJones
fixes #55
closes #196
003bb23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 8, 2012
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 init.php
View
4 init.php
@@ -219,8 +219,8 @@ function show() {
case 'text_time':
echo '<input class="cmb_timepicker text_time" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="cmb_metabox_description">', $field['desc'], '</span>';
break;
- case 'text_money':
- echo '$ <input class="cmb_text_money" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="cmb_metabox_description">', $field['desc'], '</span>';
+ case 'text_money':
+ echo null !== $field['before'] ? $field['before'] : '$', ' <input class="cmb_text_money" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="cmb_metabox_description">', $field['desc'], '</span>';
break;
case 'colorpicker':
$meta = '' !== $meta ? $meta : $field['std'];
Something went wrong with that request. Please try again.