name = __( 'Text', 'weforms' ); $this->input_type = 'text_field'; $this->icon = 'text-width'; } /** * Render the text field * * @param array $field_settings * @param integer $form_id * * @return void */ public function render( $field_settings, $form_id ) { $value = $field_settings['default']; ?>
  • print_list_attributes( $field_settings ); ?>> print_label( $field_settings, $form_id ); ?>
    help_text( $field_settings ); ?>
    check_word_restriction_func( $field_settings['word_restriction'], 'no', $field_settings['name'] . '_' . $form_id ); } ?>
  • get_default_option_settings(); $default_text_options = $this->get_default_text_option_settings( true ); return array_merge( $default_options, $default_text_options ); } /** * Get the field props * * @return array */ public function get_field_props() { $defaults = $this->default_attributes(); $props = array( 'word_restriction' => '', ); return array_merge( $defaults, $props ); } /** * Prepare entry * * @param $field * * @return mixed */ public function prepare_entry( $field ) { return sanitize_text_field( trim( $_POST[$field['name']] ) ); } }