MetaBoxes::renderField('text_price', array($this, 'pl_cmb_render_text_price'));
MetaBoxes::validateField('text_price', array($this, 'pl_cmb_validate_text_price'));

/**
 * Renders HTML markup for text_price field
 */
function pl_cmb_render_text_price( $field, $escaped_value, $object_id, $object_type, $field_type_object )
{
    echo (!$field->args['before'] ? '$ ' : ' ' ) . $field_type_object->input(
        array(
            'class' => 'cmb_text_medium'
        )
    );
}


/**
 * Converts money format to integer.
 */
function pl_cmb_validate_text_price($override_value, $value)
{
    if ('' == $value)
    {
        return;
    }

    require_once(Membership::$dir . '/common/utils/String.php');

    return String::moneyToInteger($value);
}
This entry was posted in   .
Bookmark the   permalink.

Max Chirkov has written 1 article