WordPress.org

Support

Support » Plugins and Hacks » Problem on adding class to input fields

Problem on adding class to input fields

  • Hey there, im following this tutorial to add class to input fields
    http://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/

    Here is my code:

    add_filter( 'woocommerce_billing_fields', 'wc_npr_filter_phone', 10, 1 );
    
    function wc_npr_filter_phone( $address_fields ) {
       $address_fields['billing_phone']['class'] = array('input-text input-block-level');
       return $address_fields;
    }

    its actually adding the class i want, but wrong place, it`s adding to the <strong><p></strong> wich wraps the input field, and not into the <input> itself!

    <p class="form-row input-text input-block-level validate-required" id="billing_phone_field">
       <label for="billing_phone" class="">Telefone <abbr class="required" title="obrigatório">*</abbr></label>
       <input type="text" class="input-text" name="billing_phone" id="billing_phone" placeholder="Telefone" value="4891675952">
    </p>

    what could it be?

    http://wordpress.org/extend/plugins/woocommerce/

  • The topic ‘Problem on adding class to input fields’ is closed to new replies.