RWMB_Input_Field::get_attributes PHP Method

get_attributes() public static method

Get the attributes for a field
public static get_attributes ( array $field, mixed $value = null ) : array
$field array
$value mixed
return array
    public static function get_attributes($field, $value = null)
    {
        $attributes = parent::get_attributes($field, $value);
        $attributes = wp_parse_args($attributes, array('list' => $field['datalist'] ? $field['datalist']['id'] : false, 'readonly' => $field['readonly'], 'value' => $value, 'placeholder' => $field['placeholder'], 'type' => $field['type']));
        return $attributes;
    }

Usage Example

コード例 #1
0
ファイル: checkbox.php プロジェクト: sydneycbd/meta-box
 /**
  * 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;
 }
All Usage Examples Of RWMB_Input_Field::get_attributes