<?php

/**
 * Text Field
 *
 * @package AmbassadorHub\CustomFields
 */

namespace AmbassadorHub\Fields\Fields;

use function esc_attr;
use function printf;
use function sprintf;

/**
 * Class representing a text custom field.
 */
final class TextField extends AbstractField {

	/**
	 * Constructor.
	 *
	 * Initializes the text field with ID and label.
	 *
	 * @since 1.0.0
	 */
	public function __construct() {
		$this->id    = 'text';
		$this->label = __( 'Text Field', 'ambassadorhub' );

		parent::__construct();
	}

	/**
	 * Sanitize a text value.
	 *
	 * @param mixed $value The raw value to sanitize.
	 *
	 * @return string The sanitized text value.
	 */
	public function sanitize_value( $value ) {
		return sanitize_text_field( $value );
	}
}
