get_attributes() static public method

Get the attributes for a field
static public get_attributes ( array $field, mixed $value = null ) : array
$field array
$value mixed
return array
Ejemplo n.º 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('data-options' => wp_json_encode($field['js_options'])));
     $attributes['type'] = 'text';
     return $attributes;
 }
Ejemplo n.º 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;
 }