本文整理汇总了PHP中RWMB_Field::normalize方法的典型用法代码示例。如果您正苦于以下问题:PHP RWMB_Field::normalize方法的具体用法?PHP RWMB_Field::normalize怎么用?PHP RWMB_Field::normalize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RWMB_Field
的用法示例。
在下文中一共展示了RWMB_Field::normalize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: normalize
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize($field)
{
$field = parent::normalize($field);
$field = wp_parse_args($field, array('prefix' => '', 'suffix' => '', 'std' => '', 'js_options' => array()));
$field['js_options'] = wp_parse_args($field['js_options'], array('range' => 'min', 'value' => $field['std']));
return $field;
}
示例2: normalize
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize($field)
{
$field = parent::normalize($field);
$field = wp_parse_args($field, array('flatten' => true, 'query_args' => array(), 'field_type' => 'select'));
if ('checkbox_tree' === $field['field_type']) {
$field['field_type'] = 'checkbox_list';
$field['flatten'] = false;
}
switch ($field['field_type']) {
case 'checkbox_list':
case 'radio_list':
$field['flatten'] = 'radio_list' === $field['field_type'] ? true : $field['flatten'];
$field['multiple'] = 'radio_list' === $field['field_type'] ? false : true;
$field = RWMB_Input_Field::normalize($field);
break;
case 'select_advanced':
$field = RWMB_Select_Advanced_Field::normalize($field);
$field['flatten'] = true;
break;
case 'select_tree':
$field = RWMB_Select_Field::normalize($field);
$field['multiple'] = true;
break;
case 'select':
default:
$field = RWMB_Select_Field::normalize($field);
break;
}
return $field;
}
示例3: normalize
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize($field)
{
$field = parent::normalize($field);
$field = wp_parse_args($field, array('size' => $field['multiple'] ? 5 : 0));
$field['field_name'] .= !$field['clone'] && $field['multiple'] ? '[]' : '';
return $field;
}
示例4: normalize
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize($field)
{
$field = parent::normalize($field);
$field = wp_parse_args($field, array('std' => array(), 'mime_type' => '', 'max_file_uploads' => 0, 'force_delete' => false));
$field['multiple'] = true;
return $field;
}
示例5: normalize
/**
* Normalize parameters for field
*
* @param array $field
* @return array
*/
static function normalize($field)
{
$field = parent::normalize($field);
$field = wp_parse_args($field, array('raw' => false, 'options' => array()));
$field['options'] = wp_parse_args($field['options'], array('editor_class' => 'rwmb-wysiwyg', 'dfw' => true));
// Keep the filter to be compatible with previous versions
$field['options'] = apply_filters('rwmb_wysiwyg_settings', $field['options']);
return $field;
}
示例6: normalize
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize($field)
{
$field = parent::normalize($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()));
}
return $field;
}
示例7: normalize
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize($field)
{
$field = parent::normalize($field);
$field['multiple'] = true;
$field['field_name'] = $field['id'];
if (!$field['clone']) {
$field['field_name'] .= '[]';
}
return $field;
}
示例8: normalize
/**
* Normalize parameters for field
*
* @param array $field
* @return array
*/
public static function normalize($field)
{
$field = parent::normalize($field);
$field = wp_parse_args($field, array('flatten' => true, 'options' => array()));
return $field;
}
示例9: normalize
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize($field)
{
$field = parent::normalize($field);
$field['std'] = $field['std'] ? $field['std'] : __('Click me', 'meta-box');
return $field;
}
示例10: normalize
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize($field)
{
$field = parent::normalize($field);
$field = wp_parse_args($field, array('std' => '', 'address_field' => ''));
return $field;
}
示例11: normalize
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize($field)
{
$field = parent::normalize($field);
$field = wp_parse_args($field, array('std' => '', 'address_field' => '', 'api_key' => 'AIzaSyC1mUh87SGFyf133tpZQJa-s96p0tgnraQ'));
return $field;
}
示例12: normalize
/**
* Normalize parameters for field
*
* @param array $field
* @return array
*/
static function normalize($field)
{
$field = parent::normalize($field);
$field['field_name'] .= $field['multiple'] ? '[]' : '';
return $field;
}
示例13: normalize
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize($field)
{
$field = parent::normalize($field);
$field = wp_parse_args($field, array('size' => 30, 'placeholder' => ''));
return $field;
}
示例14: normalize
/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize($field)
{
$field = parent::normalize($field);
$field['clone'] = true;
$field['multiple'] = false;
return $field;
}
示例15: normalize
/**
* Normalize parameters for field
*
* @param array $field
* @return array
*/
static function normalize($field)
{
$field = parent::normalize($field);
$field = wp_parse_args($field, array('cols' => 60, 'rows' => 3, 'maxlength' => false, 'wrap' => false, 'readonly' => false));
return $field;
}