Example #1
0
 /**
  * Get the attributes for a field
  *
  * @param array $field
  * @param mixed $value
  *
  * @return array
  */
 static function get_attributes($field, $value = null)
 {
     $attributes = parent::get_attributes($field, $value);
     $attributes = wp_parse_args($attributes, array('size' => $field['size'], 'maxlength' => $field['maxlength'], 'pattern' => $field['pattern'], 'placeholder' => $field['placeholder']));
     $attributes['type'] = 'text';
     return $attributes;
 }
Example #2
0
 /**
  * Get the attributes for a field.
  *
  * @param array $field
  * @param mixed $value
  * @return array
  */
 static function get_attributes($field, $value = null)
 {
     $attributes = parent::get_attributes($field, $value);
     $attributes['type'] = 'checkbox';
     $attributes['list'] = false;
     return $attributes;
 }
Example #3
0
 /**
  * Get the attributes for a field
  *
  * @param array $field
  * @param mixed $value
  *
  * @return array
  */
 static function get_attributes($field, $value = null)
 {
     $attributes = parent::get_attributes($field, $value);
     $attributes = wp_parse_args($attributes, array('step' => $field['step'], 'max' => $field['max'], 'min' => $field['min']));
     $attributes['type'] = 'number';
     return $attributes;
 }
Example #4
0
 /**
  * Get the attributes for a field
  *
  * @param array $field
  * @param mixed $value
  *
  * @return array
  */
 public static function get_attributes($field, $value = null)
 {
     $attributes = SWPMB_Input_Field::get_attributes($field, $value);
     $attributes['id'] = false;
     $attributes['type'] = $field['multiple'] ? 'checkbox' : 'radio';
     $attributes['value'] = $value;
     return $attributes;
 }
Example #5
0
 /**
  * Get the attributes for a field
  *
  * @param array $field
  * @param mixed $value
  *
  * @return array
  */
 static function get_attributes($field, $value = null)
 {
     $attributes = parent::get_attributes($field, $value);
     $attributes['type'] = 'hidden';
     return $attributes;
 }