本文整理汇总了PHP中RWMB_Field::normalize_field方法的典型用法代码示例。如果您正苦于以下问题:PHP RWMB_Field::normalize_field方法的具体用法?PHP RWMB_Field::normalize_field怎么用?PHP RWMB_Field::normalize_field使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RWMB_Field
的用法示例。
在下文中一共展示了RWMB_Field::normalize_field方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize_field($field)
{
$field = parent::normalize_field($field);
$field = wp_parse_args($field, array('cols' => 60, 'rows' => 3, 'maxlength' => false, 'wrap' => false, 'readonly' => false, 'placeholder' => ''));
$field['attributes'] = wp_parse_args($field['attributes'], array('cols' => $field['cols'], 'rows' => $field['rows'], 'maxlength' => $field['maxlength'], 'wrap' => $field['wrap'], 'readonly' => $field['readonly'], 'placeholder' => $field['placeholder']));
$field['attributes']['class'] .= ' large-text';
return $field;
}
示例2: array
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize_field($field)
{
$field = parent::normalize_field($field);
$field = wp_parse_args($field, array('datalist' => false, 'readonly' => false));
if ($field['datalist']) {
$field['datalist'] = wp_parse_args($field['datalist'], array('id' => $field['id'] . '_list', 'options' => array()));
}
$field['attributes'] = wp_parse_args($field['attributes'], array('list' => $field['datalist'] ? $field['datalist']['id'] : false, 'readonly' => $field['readonly']));
return $field;
}
示例3: array
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize_field($field)
{
if (!$field['clone'] && $field['multiple']) {
$field['field_name'] .= '[]';
}
$field = parent::normalize_field($field);
$field = wp_parse_args($field, array('size' => $field['multiple'] ? 5 : 0));
$field['attributes'] = wp_parse_args($field['attributes'], array('multiple' => $field['multiple'], 'size' => $field['size']));
return $field;
}
示例4: array
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize_field($field)
{
$field = parent::normalize_field($field);
$field = wp_parse_args($field, array('datalist' => false, 'disabled' => false, 'required' => false, 'readonly' => false));
if ($field['datalist']) {
$field['datalist'] = wp_parse_args($field['datalist'], array('id' => $field['id'] . '_list', 'options' => array()));
}
$field['attributes'] = wp_parse_args($field['attributes'], array('disabled' => $field['disabled'], 'list' => $field['datalist'] ? $field['datalist']['id'] : false, 'readonly' => $field['readonly'], 'required' => $field['required'], 'name' => $field['field_name'], 'class' => "rwmb-{$field['type']}", 'id' => $field['clone'] ? false : $field['id']));
return $field;
}