/** * 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; }
/** * Normalize parameters for field * * @param array $field * * @return array */ static function normalize_field($field) { $field = parent::normalize_field($field); $field['attributes']['type'] = 'password'; $field['attributes']['class'] = 'rwmb-password'; return $field; }
/** * Normalize parameters for field * * @param array $field * * @return array */ static function normalize_field($field) { $field = parent::normalize_field($field); $field['multiple'] = false; $field['attributes']['id'] = false; return $field; }
/** * Normalize parameters for field * * @param array $field * * @return array */ static function normalize_field($field) { $field = wp_parse_args($field, array('size' => 7, 'maxlength' => 7, 'pattern' => '^#+([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$', 'js_options' => array())); $field['js_options'] = wp_parse_args($field['js_options'], array('defaultColor' => false, 'hide' => true, 'palettes' => true)); $field = parent::normalize_field($field); $field['attributes'] = wp_parse_args($field['attributes'], array('data-options' => wp_json_encode($field['js_options']))); return $field; }
static function value($new, $old, $post_id, $field) { if ($new != $old) { return wp_hash_password(parent::value($new, $old, $post_id, $field)); } else { return parent::value($new, $old, $post_id, $field); } }
/** * Normalize parameters for field * * @param array $field * * @return array */ static function normalize_field($field) { $field = wp_parse_args($field, array('js_options' => array())); // Deprecate 'format', but keep it for backward compatible // Use 'js_options' instead $field['js_options'] = wp_parse_args($field['js_options'], array('showButtonPanel' => true, 'timeFormat' => empty($field['format']) ? 'HH:mm' : $field['format'])); $field = parent::normalize_field($field); $field['attributes'] = wp_parse_args($field['attributes'], array('data-options' => wp_json_encode($field['js_options']))); return $field; }
/** * Normalize parameters for field * * @param array $field * * @return array */ static function normalize_field($field) { $field = wp_parse_args($field, array('js_options' => array())); // Deprecate 'format', but keep it for backward compatible // Use 'js_options' instead $field['js_options'] = wp_parse_args($field['js_options'], array('dateFormat' => empty($field['format']) ? 'yy-mm-dd' : $field['format'], 'showButtonPanel' => true)); if (isset($field['attributes'])) { $field['attributes'] = wp_parse_args($field['attributes'], array('data-options' => wp_json_encode($field['js_options']))); } $field = parent::normalize_field($field); $field['attributes']['class'] = 'rwmb-date'; return $field; }
/** * 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; }
/** * Normalize parameters for field * * @param array $field * @return array */ static function normalize($field) { $field = parent::normalize($field); $field['clone'] = true; $field['multiple'] = true; $field['attributes']['type'] = 'text'; $field['placeholder'] = wp_parse_args((array) $field['placeholder'], array('key' => 'Key', 'value' => 'Value')); return $field; }
/** * Normalize parameters for field * * @param array $field * * @return array */ static function normalize_field($field) { $field = parent::normalize_field($field); $field['attributes']['type'] = 'url'; return $field; }
/** * Normalize parameters for field * * @param array $field * * @return array */ static function normalize($field) { $field = parent::normalize($field); $field['clone'] = true; $field['multiple'] = true; return $field; }
/** * 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('pattern' => '')); return $field; }
/** * Normalize parameters for field * * @param array $field * @return array */ static function normalize($field) { $field = parent::normalize($field); $field['clone'] = true; $field['multiple'] = true; $field['attributes']['type'] = 'text'; return $field; }