'', 'name' => 'text', 'value' => '', 'label' => '', 'title' => '', 'class' => '', 'main_label_class' => '', 'label_class' => '', 'input_class' => '', 'input_group_class' => '', 'radio_class' => '', 'action_class' => '', 'container_class' => '', 'desc' => '', 'info' => '', 'placeholder' => '', 'readonly' => false, // will not be submitted 'required' => '', 'autocomplete' => false, 'data' => false, 'disabled' => false, 'size' => 3, 'max' => 50, 'options' => array(), 'label_wrapper' => '', 'input_wrapper' => '', 'icon_color' => '', 'return_html' => false, 'unique' => true, 'text_class' => '', 'icon' => '', 'list' => array(), 'btn_text' => '', 'btn_url' => '', 'more_info_text' => '', 'more_info_url' => '', 'tooltip_title' => '', 'tooltip_body' => '', 'tooltip_args' => array(), 'is_pro' => '', 'input_size' => 'medium', 'group_data' => false ); $defaults = array_merge( $defaults, $custom_defaults ); return array_merge( $defaults, $input_array ); } /** * Renders an HTML Text field * * @param array $args Arguments for the text field * @param bool $return_html * @return false|string */ public static function text( $args = array(), $return_html=false ) { if ( $return_html ) { ob_start(); } $args = self::add_defaults( $args ); $args = self::get_specs_info( $args ); $readonly = $args['readonly'] ? ' readonly' : ''; $required = empty( $args['required'] ) ? '' : ' required'; $group_data_escaped = self::get_data_escaped( $args['group_data'] ); $data_escaped = self::get_data_escaped( $args['data'] ); ?>
>
maxlength="" />
array() ); $args = self::add_defaults( $args, $defaults ); $group_data_escaped = self::get_data_escaped( $args['group_data'] ); ?>
>
'textarea', 'class' => 'large-text', 'rows' => 4, ); $args = self::add_defaults( $args, $defaults ); $args = self::get_specs_info( $args ); $main_tag = empty( $args['main_tag'] ) ? 'li' : $args['main_tag']; $group_data_escaped = self::get_data_escaped( $args['group_data'] ); ?> < class="epkb-input-group " id="_group" >
> 'checkbox', ); $args = self::add_defaults( $args, $defaults ); $group_data_escaped = self::get_data_escaped( $args['group_data'] ); ?>
>
/>
'', 'text' => '', 'data' => '', 'topDesc' => '', 'bottomDesc' => '', 'textLoc' => 'left', 'checked' => false, 'toggleOnText' => __( 'on', 'echo-knowledge-base' ), 'toggleOffext' => __( 'off', 'echo-knowledge-base' ), 'return_html' => false, ); $args = self::add_defaults( $args, $defaults ); $args = self::get_specs_info( $args ); $text = $args['text']; $topDesc = $args['topDesc']; $bottomDesc = $args['bottomDesc']; $group_data_escaped = self::get_data_escaped( $args['group_data'] ); if ( $args['return_html'] ) { ob_start(); } ?>
>
>
>
$value ) { $label = is_array( $value ) ? $value['label'] : $value; $class = isset( $value['class'] ) ? $value['class'] : ''; echo '
' . '' . esc_html( $label ) . '
'; } ?>
'radio', 'name' => 'radio-buttons', 'desc_condition' => '', ); $args = self::add_defaults( $args, $defaults ); $args = self::get_specs_info( $args ); $ix = 0; $group_data_escaped = self::get_data_escaped( $args['group_data'] ); if ( $args['return_html'] ) { ob_start(); } ?>
>
$label ) { ?>
/>
'.$args['desc'].''; } ?>
'radio', 'name' => 'radio-buttons', ); $args = self::add_defaults( $args, $defaults ); $args = self::get_specs_info( $args ); $ix = 0; $group_data_escaped = self::get_data_escaped( $args['group_data'] ); ?>
>
$label ) { ?>
'radio', 'name' => 'checkboxes', ); $args = self::add_defaults( $args, $defaults ); $args = self::get_specs_info( $args ); $ix = 0; $group_data_escaped = self::get_data_escaped( $args['group_data'] ); ?>
>
$label ) { ?>
'radio', 'name' => 'radio-buttons', ); $args = self::add_defaults( $args, $defaults ); $args = self::get_specs_info( $args ); $ix = 0; $group_data_escaped = self::get_data_escaped( $args['group_data'] ); if ( $args['return_html'] ) { ob_start(); } ?>
>
$label ) { ?>
/>
autocomplete="" value="" placeholder="" maxlength="" />
'checkbox', 'name' => 'checkbox', 'value' => array(), 'main_class' => '', 'main_tag' => 'li' ); $args = self::add_defaults( $args, $defaults ); $ix = 0; $group_data_escaped = self::get_data_escaped( $args['group_data'] ); ?> < class=" " id="_group" >
$label ) { $tmp_value = is_array( $args['value'] ) ? $args['value'] : array(); $checked = in_array( $key, $tmp_value ); $label = str_replace( ',', '', $label ); $input_id = $args['name'] . '-' . $ix; ?>
/>
>
"/>
'; $label_wrap_close = ''; } if ( ! empty( $args['input_wrapper']) ) { $label_wrap_open = '<' . esc_html( $args['input_wrapper'] ) . ' class="' . esc_attr( $args['input_group_class'] ) . '" ' . $group_data_escaped . '>'; $label_wrap_close = '<' . esc_html( $args['input_wrapper'] ) . '>'; } if ( ! empty( $args['return_html'] ) ) { ob_start(); } echo $label_wrap_open; ?> />
$field_spec['name'], 'label' => $field_spec['label'], 'type' => $field_spec['type'], 'input_group_class' => 'epkb-admin__input-field epkb-admin__' . $field_spec['type'] . '-field' . ' ' . $args['input_group_class'], 'input_class' => ! empty( $field_spec['is_pro'] ) && ! EPKB_Utilities::is_elegant_layouts_enabled() ? 'epkb-admin__input-disabled' : '', 'is_pro' => empty( $field_spec['is_pro'] ) ? false : $field_spec['is_pro'], 'desc' => empty( $args['desc'] ) ? '' : $args['desc'], ); if ( $args_specs['type'] == 'select' ) { $args['options'] = $field_spec['options']; } return array_merge( $args, $args_specs ); } /** * Display a tooltip for admin form fields * * @param $title * @param $body * @param $args */ public static function display_tooltip( $title, $body, $args = array() ) { if ( empty( $body ) ) { return; } $defaults = array( 'class' => '', 'open-icon' => 'info-circle', 'open-text' => '', 'link_text' => __( 'Learn More', 'echo-knowledge-base' ), 'link_url' => '', 'link_target' => '_blank' ); $args = array_merge( $defaults, $args ); ?>
PRO
You need to upgrade to the PRO version to use this feature.
>
/>
$args['name'], 'teeny' => 1 ]; if ( ! empty( $args['editor_options'] ) ) { $tinymce_options = array_merge( $tinymce_options, $args['editor_options'] ); } ?>
>
>
$value ) { $data_escaped .= 'data-' . esc_attr( $key ) . '="' . esc_attr( $value ) . '" '; } return $data_escaped; } }