# LMS Forms Builder

## Filters

1. **`stm_lms_profile_form_default_fields_info`**

**Description:**\
This filter allows you to modify or extend the **default fields** of the Profile Form inside the Form Builder. It is useful when you need to add new input fields or update existing ones for student or instructor profiles.

**Parameters:**

* `$profile_form` (Array) — An array of existing form fields with their configuration.

**Example usage:**

```php
add_filter( 'stm_lms_profile_form_default_fields_info', 'stm_lms_profile_form_default_fields_info_function', 10, 1);		
function stm_lms_profile_form_default_fields_info_function( $profile_form ) {
$profile_form[] = array(
   'first_name'  => array(
      'label'       => esc_html__( 'First Name', 'masterstudy-lms-learning-management-system-pro' ),
      'placeholder' => esc_html__( 'Enter your name', 'masterstudy-lms-learning-management-system-pro' ),
   )
);

return $profile_form;
} 
```

**Explanation:**\
This example adds a new field called **First Name** to the Profile Form. The label defines what users see next to the field, while the placeholder defines the input hint inside the field.

2. **`stm_lms_form_builder_available_fields`**

**Description:**\
This filter allows you to modify or extend the **available field types** in the Form Builder. Developers can add new field types (text, textarea, dropdown, etc.) that instructors or admins can use when building forms.

**Parameters:**

* `$fields` (Array) — An array of all available field types in the form builder.

**Example usage:**

```php
add_filter( 'stm_lms_form_builder_available_fields', 'stm_lms_form_builder_available_fields_function', 10 , 1);
function stm_lms_form_builder_available_fields_function($fields){
$fields[] = array(
   'type'       => 'textarea',
   'field_name' => esc_html__( 'Text Area', 'masterstudy-lms-learning-management-system-pro' ),
);

return $fields;
}
```

**Explanation:**\
This example registers a new **Textarea** field type in the Form Builder. Once added, administrators can use it as a drag-and-drop field when creating custom forms.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stylemixthemes.com/masterstudy-lms/developers-guide/masterstudy-lms-hooks/lms-forms-builder.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
