skipv1_0_0Radio

The Facebook Fanpage Import skip v1 0 Radio class.

Defined (1)

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

/includes/skip/elements/forms/radio.php  
  1. class Radio extends Form_Element{ 
  2.  
  3. /** 
  4. * Constructor 
  5. * @since 1.0 
  6. * @param string $name Name of field. 
  7. * @param string $value The value of the checkbox element which will be saved if Radiobutton is checked. 
  8. * @param array/string $args List of Arguments. 
  9. */ 
  10. function __construct( $name, $value, $label = FALSE, $args = array() ) { 
  11. /** 
  12. * Additional parent args: 
  13. * 'id' 
  14. * 'classes' 
  15. * 'before_element' 
  16. * 'after_element' 
  17. * 'params' 
  18. */ 
  19. $defaults = array( 
  20. 'checked' => FALSE,  
  21. ); 
  22.  
  23. $args = wp_parse_args( $args, $defaults ); 
  24. $args[ 'label' ] = $label; 
  25. $args[ 'close_tag' ] = FALSE; // No Close tag for Input type Button 
  26.  
  27. parent::__construct( 'input', $name, $args ); 
  28.  
  29. $this->add_param( 'type', 'radio' ); // This is a radio button 
  30. $this->add_param( 'value', $value ); // Overwriting value from DB 
  31.  
  32. if( $value == $this->value || $this->value == 'checked' || $args[ 'checked' ] ) 
  33. $this->add_param( 'checked', 'checked' ); 
  34.