skipv1_0_0Form

The Facebook Fanpage Import skip v1 0 Form class.

Defined (1)

The class is defined in the following location(s).

/includes/skip/elements/forms/form.php  
  1. class Form extends HTML_Element{ 
  2.  
  3. var $option_group; 
  4.  
  5. /** 
  6. * WP Form constructor 
  7. * @package Skip 
  8. * @since 1.0 
  9. *  
  10. * @param string $name The name of the form 
  11. * @param string $args Array of [ 'id' ], [ 'classes' ], [ 'before_element' ], [ 'after_element' ] and [ 'params' ] 
  12. */ 
  13. function __construct( $name, $args = array() ) { 
  14. global $skip_form_name; 
  15.  
  16. /** 
  17. * Additional parent args: 
  18. * 'id' 
  19. * 'classes' 
  20. * 'before_element' 
  21. * 'after_element' 
  22. * 'params' 
  23. */ 
  24. $defaults = array( 
  25. 'enctype' => 'multipart/form-data',  
  26. 'classes' => 'skip_form' 
  27. ); 
  28.  
  29. $args = wp_parse_args( $args, $defaults ); 
  30. extract( $args, EXTR_SKIP ); 
  31.  
  32. if( '' == $name ) 
  33. return; 
  34.  
  35. $method = 'POST'; 
  36. $action = $_SERVER[ 'REQUEST_URI' ]; 
  37.  
  38. $args[ 'close_tag' ] = TRUE; 
  39.  
  40. parent::__construct( 'form', $args ); 
  41.  
  42. $skip_form_name = $name; 
  43. $this->add_param( 'name', $name ); 
  44.  
  45. if( '' != $method ) 
  46. $this->add_param( 'method', $method ); 
  47.  
  48. if( '' != $action ) 
  49. $this->add_param( 'action', $action ); 
  50.  
  51. if( '' != $enctype ) 
  52. $this->add_param( 'enctype', $enctype ); 
  53.  
  54. // Needed Fields for Form 
  55. $needed_fields = wp_nonce_field( 'skip_form_' . $name, $name . '_wpnonce', TRUE , FALSE ) ; 
  56. $needed_fields.= '<input type="hidden" name="MAX_FILE_SIZE" value="' . max_upload() . '" />'; 
  57.  
  58. $this->add_element( $needed_fields );