skipv1_0_0Form
The WordPress Core skip v1 0 Form class.
Defined (1)
The class is defined in the following location(s).
- /includes/skip/elements/forms/form.php
- class Form extends HTML_Element{
- var $option_group;
- /**
- * WP Form constructor
- *
- * @package Skip
- * @since 1.0
- *
- * @param string $name The name of the form
- * @param string $args Array of [ 'id' ], [ 'classes' ], [ 'before_element' ], [ 'after_element' ] and [ 'params' ]
- */
- function __construct( $name, $args = array() ) {
- global $skip_form_name;
- /**
- * Additional parent args:
- * 'id'
- * 'classes'
- * 'before_element'
- * 'after_element'
- * 'params'
- */
- $defaults = array(
- 'enctype' => 'multipart/form-data',
- 'classes' => 'skip_form'
- );
- $args = wp_parse_args( $args, $defaults );
- extract( $args, EXTR_SKIP );
- if( '' == $name )
- return;
- $method = 'POST';
- $action = $_SERVER[ 'REQUEST_URI' ];
- $args[ 'close_tag' ] = TRUE;
- parent::__construct( 'form', $args );
- $skip_form_name = $name;
- $this->add_param( 'name', $name );
- if( '' != $method )
- $this->add_param( 'method', $method );
- if( '' != $action )
- $this->add_param( 'action', $action );
- if( '' != $enctype )
- $this->add_param( 'enctype', $enctype );
- // Needed Fields for Form
- $needed_fields = wp_nonce_field( 'skip_form_' . $name, $name . '_wpnonce', TRUE , FALSE ) ;
- $needed_fields.= '<input type="hidden" name="MAX_FILE_SIZE" value="' . max_upload() . '" />';
- $this->add_element( $needed_fields );
- }
- }