本文整理汇总了PHP中RWMB_Select_Field::get_attributes方法的典型用法代码示例。如果您正苦于以下问题:PHP RWMB_Select_Field::get_attributes方法的具体用法?PHP RWMB_Select_Field::get_attributes怎么用?PHP RWMB_Select_Field::get_attributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RWMB_Select_Field
的用法示例。
在下文中一共展示了RWMB_Select_Field::get_attributes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_attributes
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
*
* @return array
*/
public static function get_attributes($field, $value = null)
{
$attributes = parent::get_attributes($field, $value);
$attributes['multiple'] = false;
$attributes['id'] = false;
return $attributes;
}
示例2: get_attributes
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
*
* @return array
*/
static function get_attributes($field, $value = null)
{
switch ($field['field_type']) {
case 'checkbox_list':
case 'radio_list':
$attributes = RWMB_Input_Field::get_attributes($field, $value);
$attributes['class'] = "rwmb-choice";
$attributes['id'] = false;
$attributes['type'] = 'radio_list' === $field['field_type'] ? 'radio' : 'checkbox';
break;
case 'select_advanced':
$attributes = RWMB_Select_Advanced_Field::get_attributes($field, $value);
$attributes['class'] = "rwmb-choice rwmb-select_advanced";
break;
case 'select_tree':
$attributes = RWMB_Select_Field::get_attributes($field, $value);
$attributes['multiple'] = false;
break;
case 'select':
default:
$attributes = RWMB_Select_Field::get_attributes($field, $value);
break;
}
$attributes['name'] .= !$field['clone'] && $field['multiple'] ? '[]' : '';
return $attributes;
}
示例3: array
/**
* 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;
}
示例4: get_attributes
/**
* Get the attributes for a field
*
* @param array $field
* @param mixed $value
*
* @return array
*/
public static function get_attributes($field, $value = null)
{
switch ($field['field_type']) {
case 'checkbox_list':
case 'radio_list':
return RWMB_Input_List_Field::get_attributes($field, $value);
break;
case 'select_advanced':
$attributes = RWMB_Select_Advanced_Field::get_attributes($field, $value);
$attributes['class'] .= ' rwmb-select_advanced';
return $attributes;
break;
case 'select_tree':
return RWMB_Select_Tree_Field::get_attributes($field, $value);
break;
case 'select':
default:
return RWMB_Select_Field::get_attributes($field, $value);
break;
}
}