build_control_header($control_key, $label, 'TEXT', $is_responsive); // Add TEXT-specific properties FIRST (before common properties) $content .= $this->build_text_properties($field); // Add common properties (default, placeholder, description, separator, condition, etc.) // This includes: default, placeholder, description, label_block, show_label, // dynamic, separator, condition/conditions, selectors // Note: responsive is handled via method name change in header $content .= $this->build_common_properties($field); // Close control $content .= $this->build_control_footer(); return $content; } /** * Build TEXT-specific properties * These are properties unique to TEXT control type * * @param array $field Field configuration from React UI * @return string */ protected function build_text_properties($field) { $content = ''; // Input type (HTML5 input types: text, url, email, tel, password, search, number) // From form: Not visible in image, but supported by Elementor if (!empty($field['input_type']) && $field['input_type'] !== 'text') { $content .= $this->format_plain_string_property('input_type', $field['input_type']); } // Title (tooltip on hover) // From form: Not visible in image, but supported by Elementor if (!empty($field['title'])) { $content .= $this->format_string_property('title', $field['title']); } // Classes (custom CSS classes for control wrapper in the panel) // From form: "Control Classes" field - "Add custom classes to control wrapper in the panel" if (!empty($field['classes'])) { $content .= $this->format_plain_string_property('classes', $field['classes']); } return $content; } protected function default_label() { return 'Text'; } protected function get_type_specific_config($field) { $config = []; if (!empty($field['input_type']) && $field['input_type'] !== 'text') { $config['input_type'] = $field['input_type']; } if (!empty($field['title'])) { // translators: dynamic user-defined control title/tooltip. $config['title'] = esc_html($field['title']); } if (!empty($field['classes'])) { $config['classes'] = $field['classes']; } return $config; } } /** * FIELD MAPPING FROM REACT UI TO PHP: * ==================================== * * From Control Settings Panel [Image #1]: * * 1. Dynamic Support (toggle) → field['dynamic'] → handled by base class * Output: 'dynamic' => ['active' => true] * * 2. Separator (dropdown: None/Before/After) → field['separator'] → handled by base class * Output: 'separator' => 'none|before|after' * * 3. Conditions (condition builder) → field['condition'] → handled by base class * Example: ['other_control' => 'value'] * Output: 'condition' => ['other_control' => 'value'] * * 4. Control Classes (text input) → field['classes'] → handled in build_text_properties() * Output: 'classes' => 'custom-class-name' * * 5. Selector (text input) → field['selector'] or field['selectors'] → handled by base class * Example: {{WRAPPER}} .control-class * Output: 'selectors' => ['{{WRAPPER}} .control-class' => 'css-property'] * * Additional common fields: * - Label → field['label'] → used in control header * - Name → used for $control_key * - Description → field['description'] → handled by base class * - Placeholder → field['placeholder'] → handled by base class * - Default Value → field['default'] → handled by base class * - Show Label → field['show_label'] → handled by base class * - Label Block → field['label_block'] → handled by base class * - Responsive Control → field['responsive'] → handled by base class */