
Argument 3: A string, valid for an HTML attribute, used as the name and id.
See below for default and potential settings here.
Argument 2: An array of settings that are merged with the default settings to control the display and type of field. If you use a simple label like "email" here, make sure to set a more specific name in argument 3. Argument 1: A human-readable label that is parsed and turned into the name and id, if these options aren't explicitly set. $new_form-> add_input( 'I am a little field', array(), 'little_field') Either way, the order they are added is the order in which they'll show up.Īdd fields using their label (in human-readable form), an array of settings, and a name/id slug, if needed. Inputs can be added one at a time or as a group. 3) Add inputs, in order you want to see them If no submit type is added, add one automatically $new_form-> set_att( 'form_element', true) Ĭurrently, there are some restrictions to what can be added but no check as to whether the classes or ids are valid so be mindful of that. Wraps the inputs with a form element $new_form-> set_att( 'form_element', true) Adds a blank, hidden text field for spam control $new_form-> set_att( 'add_honeypot', true) Adds a WordPress nonce field using the string being passed $new_form-> set_att( 'add_nonce', 'build_a_nonce_using_this') Adds the HTML5 "novalidate" attribute $new_form-> set_att( 'novalidate', true) Add an id to the form $new_form-> set_att( 'id', 'xhtml')
Classes are added as an array $new_form-> set_att( 'class', array()) Can be set to 'html' or 'xhtml' $new_form-> set_att( 'markup', 'xhtml') Change the enctype $new_form-> set_att( 'enctype', 'multipart/form-data') Change the submit method $new_form-> set_att( 'method', 'get') Add a new form action $new_form-> set_att( 'action', '')