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); }

custom-meta-field-types

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.

Matt Barrett has written 1 article

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>