Example #1
0
 /**
  * Normalize parameters for field
  *
  * @param array $field
  *
  * @return array
  */
 static function normalize($field)
 {
     $field = parent::normalize($field);
     $field['multiple'] = false;
     $field['attributes']['id'] = false;
     return $field;
 }
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'] = 'password';
     return $attributes;
 }
Example #3
0
 /**
  * Normalize parameters for field
  *
  * @param array $field
  * @return array
  */
 static function normalize($field)
 {
     $field = parent::normalize($field);
     $field['clone'] = true;
     $field['multiple'] = true;
     return $field;
 }
Example #4
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('data-options' => wp_json_encode($field['js_options'])));
     return $attributes;
 }